The History of British Ceylon began in 1815 when the Kandyan Kingdom fell into the hands of the British. It ended over 2300 years of Sinhalese monarchy rule on the island. The British rule on the island lasted until 1948 when the country gained independence.
The first Europeans to visit Sri Lanka in modern times were the Portuguese: Lourenço de Almeida arrived in 1505, finding the island divided into seven warring kingdoms and unable to fend off intruders. The Portuguese founded a fort at the port city of Colombo in 1517 and gradually extended their control over the coastal areas. In 1592 the Sinhalese moved their capital to the inland city of Kandy, a location more secure against attack from invaders. Intermittent warfare continued through the 16th century. Many lowland Sri Lankans were forced to convert to Christianity while the coastal Moors were religiously persecuted and forced to retreat to the Central highlands while some of them desired to leave the country. The Buddhist majority disliked Portuguese occupation and its influences and welcomed any power who might rescue them and defeat the Portuguese. In 1602, therefore, when the Dutch captain Joris van Spilbergen landed, the king of Kandy appealed to him for help.
It was in 1669 that the Dutch attacked in earnest but ended with an agreement (which was disrespected by both parties), and not until 1656 that Colombo fell. By 1660 the Dutch controlled the whole island except the kingdom of Kandy. The Dutch (who were Protestants) persecuted the Catholics (the left-over Portuguese settlers) but left the Buddhists, Hindus and Muslims alone. However, they taxed the people far more heavily than the Portuguese had done. A mixed Dutch-Sri Lankan people known as Burgher peoples are the legacy of Dutch rule.
In 1669, the British sea captain Robert Knox landed by chance on Sri Lanka and was captured by the king of Kandy. He escaped 19 years later and wrote an account of his stay. This helped to bring the island to the attention of the British.