The worshipping the tooth relic of Buddha and taking it around the city was inherited to Sinhalese culture in the time of King Kithsiri Meghawanna who was ruling in Anuradhapura. This tooth relic was gifted by the King Guhasiva in India which was the ruler of Kalinga. The waging war at that time in Kalinga made King Guhasiva to make this decision.The Sacred tooth relic was send in the hands of son in law and daughter of King Guhasiva who are Pince Dantha & Princess Hemamala.After the tooth relic was in Sri Lanka the Kings who ruled from time to time worshiped it and made a tradition of parading the tooth relic around the main cities of the Kingdom.
Because of the invasion that Sinhalese Kingdom faced time to from outside countries the Kingdom moved from one location to another time to time. The Kingdom respectfully moved from Anuradhapura to Polonnaruwa from there to Dambadeniya. After the Damabadeniya Kingdom fell Kingdom moved Gampola and from there to Sri Jayewardenepura Kotte . From Kotte it was taken to final resting place Kandy.Every time the Kingdom fell and moved to another place the Kings who ruled the Kingdom made a new house to protect the sacred tooth relic and the successor kings made these house more elegant by adding new features to it. It was there duty to protect the sacred tooth relic by life because it was a symbol of the right to rule.
Below mentioned are some places that sacred tooth relic was kept in the times of invasions before the temple of the tooth Kandy.
Niyamgampaya Rajamaha Viharaya ( Niyamgampaya Teample ) – Gampola
On the road between Gampola and Nawalapitiya, the Gampola Niyamgampaya Rajamaha Viharaya is located in Mariyawattha. The history of the temple is obscure, however it may be inferred from historical records that it dates back to the early Christian era. The Nampota and Chulavamsa chronicles refer to the temple as "Niyamgampaya Stanaya," respectively. According to the illustrious chronicle Mahavamsa, the Mahaweli River's banks were the site of a temple built by King Surathissa (187–177 BC). On his return back from the Sri Pada, Vijayabahu IV (1270–1272), is said to have renovated this temple, according to Chulavamsa.
According to an inscription from 1373 AD, a man by the name of Jayamahale Sitana restored and provided land and built a monastery building for monks. The same inscription states that this temple has been a monks' residence for the last 485 years, which dates it to 888 AD. The Sacred Tooth Relic of Buddha was reportedly kept in this temple during the reigns of Parakramabahu V (1344–1359) of Dedigama and Vickramabahu II (1357–1374) of Gampola, according to the "Sinhala Dalada Vamsaya" and 18th-century works. The Shrine was a two-story structure supported by stone pillars.
The historical structures in this temple no longer exist. The plinth molding of the ancient building is visible in the main shrine area, where bas reliefs of musicians, drummers, dancers, animals, and lotus patterns may be seen. Stone makes up the door frame. The priceless Buddha statue that had stood here was taken in 1907.
Delgamuwa Raja Maha Viharaya
All Sri Lankan Buddhists consider Delgamuwa Rajamaha Viharaya to be a significant place of worship because it housed the Buddha's sacred tooth relic for more than 40 years while keeping the Portuguese at bay. It is still possible to observe the ancient Kurahan grinding stone in this Delgamuwa shrine where the sacred tooth relic was safely hidden.
To protect his throne, the notoriously inept King Dharmapala of Kotte converted to Catholicism in 1557. Dharmapala attained the status of a puppet king, and through him, the Portuguese gained total control over the Kingdom. Knowing that the Diyawadana Nilame will pose a threat to the Tooth Relic, Hiripitiye Diyavadna Rala, to transport the tooth relic from Kotte to King Mayadunne of Sitawaka (now Avissawella), the custodian swam the Diyawant to Oya (river).
The Delgamuwa Rajamaha Viharaya was where the king had it secreted since he feared a Portuguese attack at any moment. Sensing danger, the vihara's ruler ordered the creation of fake duplicates out of ivory. Giving one to Vidiya Bandara and the thera, keeping the other at the location of the original, and hiding the real one within a grinding stone (Kurahan Gala).
The old Dalada Maligawa (The Shrine of the Tooth Relic) at Kotte Kingdom had already been demolished by the Portuguese at this point, and a Catholic Church had been erected on top of it. Then, believing the fake relic to be the genuine article, they stormed Sitawaka and took it away, sending it to Goa to be destroyed.
The Relic was actually a duplicate, and the original was held by Vidiya Bandara, the son-in-law of King Mayadunne, until the Portuguese learned this. On the edict of the Archbishop of Goa, Vidiya Bandara was taken prisoner in 1561. After obtaining the fake relic from Vidiya Bandara, the archbishop crushed it, burned the powder in a brazier, and dumped the ashes into a river.
The genuine Relic was given to Konappu Bandara, who succeeded Wimaladharmasuriya I as king of Kandy, in 1592. The king then had the Relic placed in a temple in Kandy.