The early modern period of Sri Lanka begins with the arrival of Portuguese soldier and explorer Lourenço de Almeida, the son of Francisco de Almeida, in 1505. In 1517, the Portuguese built a fort at the port city of Colombo and gradually extended their control over the coastal areas. In 1592, after decades of intermittent warfare with the Portuguese, Vimaladharmasuriya I moved his kingdom to the inland city of Kandy, a location he thought more secure from attack. In 1619, succumbing to attacks by the Portuguese, the independent existence of the Jaffna kingdom came to an end.
During the reign of the Rajasinha II, Dutch explorers arrived on the island. In 1638, the king signed a treaty with the Dutch East India Company to get rid of the Portuguese who ruled most of the coastal areas. The following Dutch–Portuguese War resulted in a Dutch victory, with Colombo falling into Dutch hands by 1656. The Dutch remained in the areas they had captured, thereby violating the treaty they had signed in 1638. The Burgher people, a distinct ethnic group, emerged as a result of intermingling between the Dutch and native Sri Lankans in this period.
The Kingdom of Kandy was the last independent monarchy of Sri Lanka. In 1595, Vimaladharmasurya brought the sacred Tooth Relic – the traditional symbol of royal and religious authority amongst the Sinhalese – to Kandy, and built the Temple of the Tooth. In spite of on-going intermittent warfare with Europeans, the kingdom survived. Later, a crisis of succession emerged in Kandy upon king Vira Narendrasinha‘s death in 1739. He was married to a Telugu-speaking Nayakkar princess from South India (Madurai) and was childless by her.
Eventually, with the support of bhikku Weliwita Sarankara, the crown passed to the brother of one of Narendrasinha’s princesses, overlooking the right of “Unambuwe Bandara”, Narendrasinha’s own son by a Sinhalese concubine. The new king was crowned Sri Vijaya Rajasinha later that year. Kings of the Nayakkar dynasty launched several attacks on Dutch controlled areas, which proved to be unsuccessful.
During the Napoleonic Wars, fearing that French control of the Netherlands might deliver Sri Lanka to the French, Great Britain occupied the coastal areas of the island (which they called Ceylon) with little difficulty in 1796. Two years later, in 1798, Sri Rajadhi Rajasinha, third of the four Nayakkar kings of Sri Lanka, died of a fever. Following his death, a nephew of Rajadhi Rajasinha, eighteen-year-old Kannasamy, was crowned. The young king, now named Sri Vikrama Rajasinha, faced a British invasion in 1803 but successfully retaliated. The First Kandyan War ended in a stalemate.