After the pari-nirvana of Gautama Buddha, the tooth relic was preserved in Kalinga and smuggled to the island by Princess Hemamali and her husband, Prince Dantha on the instructions of her father King Guhasiva. They landed in the island in Lankapattana during the reign of Sirimeghavanna of Anuradhapura (301-328) and handed over the tooth relic. The king enshrined it Meghagiri Vihara (present day Isurumuniya) in Anuradhapura. Safeguard of the relic was a responsibility of the monarch, therefore over the years, the custodianship of relic became to symbolize the right to rule. Therefore, reigning monarchs built the tooth relic temples quite close to their royal residences, as was the case during the times of the Anuradhapura Kingdom, Kingdom of Polonnaruwa, and the Kingdom of Dambadeniya. During the era of the Kingdom of Gampola, the relic was housed in Niyamgampaya Vihara. It is reported in the messenger poems such as Hamsa, Gira, and Selalihini that the temple of tooth relic was situated within the city of Sri Jayawardenepura Kotte when the Kingdom of Kotte was established there.
During the reign of Dharmapala of Kotte, the relic was kept hidden in Delgamuwa Vihara, Ratnapura, in a grinding stone. It was brought to Kandy by Hiripitiye Diyawadana Rala and Devanagala Rathnalankara Thera. King Vimaladharmasuriya I built a two-storey building to deposit the tooth relic and the building is now gone. In 1603 when the Portuguese invaded Kandy, it was carried to Meda Mahanuwara in Dumbara. It was recovered during the time of Rajasinha II and it has been reported that he reinstated the original building or has built a new temple.The present day temple of the tooth was built by Vira Narendra Sinha.The octagonal Patthirippuwa and moat were added during the reign of Sri Vikrama Rajasinha. Famous Kandyan architect Devandra Mulacharin is credited with building the Patthirippuwa. Originally it was used by the kings for recreational activities and later it was offered to the tooth relic. Now it is a library. It was attacked on two occasions, the 1998 Temple of the Tooth attack by the terrorist organization Liberation Tigers of Tamil Eelam.