He ascended to the throne in the midst of the long conflict against Baekje and Goguryeo, shortly after General Ge-Baek and Baekje had been defeated at Puyo by General Kim, Yoo-Sin. The first years of his reign were spent trying to defeat Goguryeo, following an abortive attempt in 661. Finally, in 667, he ordered another attack which led, in 668, to the defeat of Goguryeo. After the small isolated pockets of resistance were eliminated, King Munmu was the first ruler ever to look upon the Korean peninsula and see it completely unified.
King Munmu ruled over unified Silla for 20 years, until he fell ill in 681. On his deathbed, he left his last will and testament, and abdicated to his son, Prince Sinmun. Before he died he said “A country should not be without a king at any time. Let the Prince have my crown before he has my coffin. Cremate my remains and scatter the ashes in the sea where the whales live. I will become a dragon and thwart the Japanese invasion.” King Sinmun did as his father asked and scattered his ashes over Daewangam (the Rock of the Great King), a small rocky islet a hundred metres or so off the Korean coast. Moreover, King Sinmun built the Gomun Temple (the Temple of Appreciated Blessing) and dedicated it to his father, he built a waterway for the sea dragon to come to and from the sea and land, and he built a pavilion, Eegun, overlooking the islet so that future kings could pay their respects to the great King Munmu.
In a dream, King Munmu and the famous general Kim, Yoo-Sin appeared to King Sinmun and said to him "Blowing on a bamboo flute will calm the heavens and the earth." King Sinmun awoke from the dream, rode out to the sea and received the bamboo flute Monposikjuk. It was said that the blowing of the bamboo flute invoked the spirits of King Munmu and General Kim, Yoo-Sin and would push back enemy troops, cure illnesses, bring rain during drought and halt the rains in floods.