The area is thought to be inhabited from as early as the 7th to 3rd century BC. Statues and paintings in these caves date back to the 1st century BC. But the paintings and statues were repaired and repainted in the 11th, 12th, and 18th century AD. The caves in the city provided refuge to King Valagamba (also called Vattagamini Abhaya) in his 14-year-long exile from the Anuradapura kingdom. Buddhist monks meditating in the caves of Dambulla at that time provided the exiled king protection from his enemies. When King Valagamba returned to the throne at Anuradapura kingdom in the 1st century BC, he had a magnificent rock temple built at Dambulla in gratitude to the monks in Dambulla. At the Ibbankatuwa Prehistoric burial site near Dhambulla, prehistoric (2700 years old) human skeletons were found on scientific analysis to give evidence of civilisations in this area long before the arrival of Buddhism in Sri Lanka. Evidence of ancient people living on agriculture have been detected in this area for over 2700 years according to archaeological findings. (750 BC) It was earlier known as Dhamballai. This was ruled by Kings like Raja Raja Chola, Rajendra Chola, etc. during their tenure in the late 10th century and early 11th century.