Around 45km north of Kurunegala, just off the road to Anuradhapura, lies the magnificent citadel of Yapahuwa, built around a huge granite rock rising almost 100m above the surrounding lowlands. Yapahuwa was one of the shortlived capitals established during the collapse of Sinhalese power in the thirteenth century founded by Bhuvanekabahu I (ruled 1272–84), who transferred the capital here from the less easily defensible Polonnaruwa in the face of recurrent attacks from South India, bringing the Tooth Relic with him. The move proved to be of no avail, however. In 1284, Yapahuwa was captured by the army of the South Indian Pandyan dynasty, who carried off the Tooth Relic to Madurai in Tamil Nadu. Following its capture, Yapahuwa was largely abandoned and taken over by monks and hermits, and the capital was moved to Kurunegala.