Yapahuwa which is 767 feet, above sea level is situated in the North Western Province in the district of Kurunegala. It is the second ancient rock fortress, the first being Sigiriya. It is situated 3 miles east of Maho railway station on the northern line. Defensive measures have been taken to protect this capital. The fortress on the Yapahuwa rock was built by a minister named Subha. Before Yapahuwa became a fortress and a capital there is evidence that the Bhikkhus resided in some of the caves.
As this was the home of the Minister Subha, this was named as “Subha” mountain and was also called”Sundara Giriya”, “Ayo Pabbata” and “Yapahuwa”.
The frequent changes of capital during this period were intimately connected with the political history of the island. A general sense of insecurity appears to have pervaded the political atmosphere of the Polonnaruwa Kingdom. It was King Vijayabahu III who first made Dambadeniya his capital. His son Parakramabahu II also ruled from Dambadeniya.