The architecture of ancient Sri Lanka displays a rich diversity, varying in form and architectural style from the Anuradhapura Kingdom (377 BC–1017) through the Kingdom of Kandy (1469–1815). Sri Lankan (Sinhalese architecture also displays many ancient North Indian as well as East Asian influences). Buddhism had a significant influence on Sri Lankan architecture after it was introduced to the island in the 3rd century BC, and ancient Sri Lankan architecture was mainly religious, with more than 25 styles of Buddhist monasteries. Significant buildings include the stupas of Jetavanaramaya and Ruwanvelisaya in the Anuradhapura kingdom and further in the Polonnaruwa Kingdom (11th–13th centuries). The palace of Sigiriya is considered a masterpiece of ancient architecture and ingenuity, and the fortress in Yapahuwa and the Temple of the tooth in Kandy are also notable for their architectural qualities. Ancient Sri Lankan architecture is also significant to sustainability, notably Sigiriya which was designed as an environmentally friendly structure.
Monasteries were designed using the Manjusri Vasthu Vidya Sastra, a manuscript which outlines the layout of the structure. The text is in Sanskrit but written in Sinhala script. The script is believed to be from the 5th century, It is exclusively about Buddhist monasteries and is clearly from the Mahayana school. The text shows much originality and there is nothing similar in the existing Indian treatises, which deal only with Hindu temples.
The earliest evidence of rudimentary cave temples are found in Mihintale, a unique feature in these caves was the use of a drip ledge carved along the top edge of the rock ceiling which stopped rain water running into the cave. With time doors, windows and walls of brick or stone were added. The roof and walls were plastered white and finished with decorative paintings, these are evident in the cave temples of Dambulla.