The royal power of Goguryeo Dynasty in the latter half of King Munja's(文咨王) reign was weak when compared with the late 5th century. King Anjang(安臧王) who succeeded to the throne after his father began to strengthen royal authority.
Goguryeo established diplomatic relations with the North and South Dynasties(南北朝) and watched the development of the situation in the 520's. As the Northern Wei(北魏) fell into disorder and civil war, Goguryeo broke off diplomatic relations with Northern Wei. Accordingly, Goguryeo dispatched an envoy to Yang(梁) in 526, groping for a change in foreign policy. Meanwhile Goguryeo made full defensive preparations and on the other hand it attacked Northen Wei. In this manner, Goguryeo kept close watch over the movements of Northen Wei.
King Anjang attacked Baekje(百濟) which underwent a change of the throne. As a result, Goguryeo occupied the Han River Valley(漢水). In addition, King Anjang made a tour of the country so as to see how the people were living, after he had worshipped at the ancestral shrine of the royal family.
But, he was assassinated in 531 and political reform was stopped. It seems King Anjang was assassinated by those who opposed his foreign policy. King Anwon(安原王) succeeded to the throne with the help of royal in-laws. However, Goguryeo met with frequent natural disasters during his reign. From this we know that royal power was weakened.
As a result, Goguryeo dispatched an envoy to Northen Wei in 532, groping for a change in foreign policy. Since then Goguryeo dispatched envoys to Eastern Wei(東魏) every year. Because Baekje and Silla(新羅) were busy fighting each other over Gaya(加耶), relations with Goguryeo weer stable. Since Baekje attacked Goguryeo in 540, the relations between the two countries grew worse.