Aluvihare Rock Temple was the historic location where the Pāli Canon was first written down completely in text on ola (palm) leaves.
There was also a South Indian invasion at the same time and the Buddhist monks of that era realized that these problems would be a danger to the existence of Buddha Sasana in the country.
Due to the famine Buddhist monks did not receive sufficient alms and faced many difficulties, and they had to eat yams, roots and leaves of trees for their survival.
King Walagamba who was overthrown by a rebellion during the invasion from South India, regained the throne by defeating the invaders after fourteen years.
The monks who left to India and to the hilly areas of Sri Lanka, during the difficult period, returned to Anuradhapura, and decided to transcribe the Tripiṭaka (philosophical doctrines of Buddhism) for the preservation and for the use of future generations.
[citation needed] It is said that 500 scholarly monks congregated at Aluvihare Rock temple to perform the difficult task of first reciting the doctrines and agreeing on an acceptable version before transcription.
The old library at Aluvihare Rock Temple, which had safely housed the volumes of this transcribed manuscripts for so many centuries, was totally destroyed during the Matale Rebellion in 1848.