Yapahuwa was one of the ephemeral capitals of medieval Sri Lanka. The citadel of Yapahuwa lying midway between Kurunagala and Anuradhapura was built around a huge granite rock rising abruptly almost a hundred meters above the surrounding lowlands.
In 1272, King Bhuvenakabahu transferred the capital from Polonnaruwa to Yapahuwa in the face of Dravidian invasions from South India, bringing the Sacred Tooth Relic with him. Following the death of King Bhuvenakabahu in 1284, the Pandyans of South India invaded Sri Lanka once again, and succeeded in capturing Sacred Tooth Relic. Following its capture, Yapahuwa was largely abandoned and inhabited by Buddhist monks and religious ascetics.