The earliest inhabitants of Sri Lanka were probably ancestors of the Vedda people, an indigenous people numbering approximately 2,500 living in modern-day Sri Lanka.
During the protohistoric period (1000–500 BCE) Sri Lanka was culturally united with southern India, and shared the same megalithic burials, pottery, iron technology, farming techniques and megalithic graffiti. This cultural complex spread from southern India along with Dravidian clans such as the Velir, prior to the migration of Prakrit speakers.
One of the first written references to the island is found in the Indian epic Ramayana, which provides details of a kingdom named Lanka that was created by the divine sculptor Vishwakarma for Kubera, the Lord of Wealth. It is said that Kubera was overthrown by his demon stepbrother Ravana.
Ancient Sri Lanka:
According to the Mahāvamsa, a Pāḷi chronicle written in the 5th century CE, the original inhabitants of Sri Lanka are said to be the Yakshas and Nagas. Ancient cemeteries that were used before 600 BCE and other signs of advanced civilization have also been discovered in Sri Lanka. Sinhalese history traditionally starts in 543 BCE with the arrival of Prince Vijaya, a semi-legendary prince who sailed with 700 followers to Sri Lanka, after being expelled from Vanga Kingdom (present-day Bengal). He established the Kingdom of Tambapanni, near modern-day Mannar. Vijaya (Singha) is the first of the approximately 189 monarchs of Sri Lanka described in chronicles such as the Dipavamsa, Mahāvaṃsa, Cūḷavaṃsa, and Rājāvaliya.
Once Prakrit speakers had attained dominance on the island, the Mahavamsa further recounts the later migration of royal brides and service castes from the Tamil Pandya Kingdom to the Anuradhapura Kingdom in the early historic period.
Succeeding kingdoms of Sri Lanka would maintain many Buddhist schools and monasteries and support the propagation of Buddhism into other countries in Southeast Asia. Sri Lankan Bhikkhus studied in India’s famous ancient Buddhist University of Nalanda, which was destroyed by Bakhtiyar Khilji. It is probable that many of the scriptures from Nalanda are preserved in Sri Lanka’s many monasteries and that the written form of the Tripiṭaka, including Sinhalese Buddhist literature, were part of the University of Nalanda. In 245 BCE, bhikkhuni Sanghamitta arrived with the Jaya Sri Maha Bodhi tree, which is considered to be a sapling from the historical Bodhi Tree under which Gautama Buddha became enlightened. It is considered the oldest human-planted tree (with a continuous historical record) in the world. (Bodhivamsa)
Sri Lanka experienced the first of many foreign invasions during the reign of Suratissa, who was defeated by two horse traders named Sena and Guttika from South India. The next invasion came immediately in 205 BCE by a Chola named Elara, who overthrew Asela and ruled the country for 44 years. Dutugamunu, the eldest son of the southern regional sub-king, Kavan Tissa, defeated Elara in the Battle of Vijithapura. During its two and a half millennia of existence, the Sinhala Kingdom was invaded at least eight times by neighboring South Indian dynasties such as the Chola, Pandya, Chera, and Pallava. These invaders were all subsequently driven back. There also were incursions by the kingdoms of Kalinga (modern Odisha) and from the Malay Peninsula as well.
Sri Lanka was the first Asian country known to have a female ruler: Anula of Anuradhapura (r. 47–42 BCE). Sri Lankan monarchs undertook some remarkable construction projects such as Sigiriya, the so-called “Fortress in the Sky”, built during the reign of Kashyapa I of Anuradhapura, who ruled between 477 and 495. The Sigiriya rock fortress is surrounded by an extensive network of ramparts and moats. Inside this protective enclosure were gardens, ponds, pavilions, palaces and other structures.