The Temple of the Tooth Relic (Sri Dalada Maligawa) is in the center of the city and was originally built by the Kandyan Kings between 1687 and 1707 in order to house and honor the sacred tooth relic. `Maligawa`(place) literally translates to palace, and the temple is part of the palace complex.
However, it was hidden in the hair of Princess Hemamali, who fled the Hindu armies besieging her father`s kingdom in India, and instantly became an object of great reverence, making it enshrined in a series of nested jeweled reliquaries. The responsibility of the relic was to the monarch; thus, over the years, the custodianship of the relic became to symbolize the right to rule.
That is why there are the tooth relic temples that are built so close to the royal residences, as they were during the times of the Anuradhapura Kingdom, Kingdom of Polonnaruwa, and Kingdom of Dambadeniya. Still, the tooth was brought out for every special occasion that occurred in the country, and it was paraded on the backs of elephants, which are actually very sacred to the Buddha.