The prominent rock at Yapahuwa and its accompanying ruins are of interest because of the brief part they played in the long drama of the sacred Tooth Relic. After the death of King Prakramabahu II, Sri Lanka fell into chaos again with various factions vying with each other for power. In 1272 Bhauvanekabahu I became king and moved his capital from Polonnaruwa to Yapahuwa taking the Tooth Relic with him. Yapahuwa had been the stronghold of a general called Subha and Bhauvanekabahu set about strengthening it and making it suitable as a royal residence. But the king had been reduced to little more than a regional lord and by any standard Yapahuwa is a very modest place. However he was in possession of the Tooth and for as long as he had it the people would look to him as their ruler.
Read more details on government website: Yapahuwa