Goryeo adopted a Silla-friendly, Hubaekje-hostile attitude in the later Three Kingdoms, but in 927, Goryeo was defeated by Hubaekje in present-day Daegu. Wang Geon, a descendant of a merchant family of Songdo (present-day Kaesong), joined Taebong at first but overthrew Gung Ye later on and established the Goryeo Kingdom and Dynasty in 918. Together with the declining Silla, they are known as the Later Three Kingdoms. Gung Ye established Hugoguryeo (meaning 'Later Goguryeo,' renamed Taebong and Majin) while Gyeon Hwon established Hubaekje (meaning 'Later Baekje'). The country entered a period of civil war and rebellion, led by Gung Ye, Gi Hwon, Yang Gil, and Gyeon Hwon.
Silla, which had accomplished an incomplete unification of the Three Kingdoms of Korea in 668, weakened and lost control over local lords during the end of the 9th century.