Look at a map of colonial Sri Lanka at almost any point between 1600 and 1815 and you will see something unusual: a ring of European-controlled coastline wrapped around a stubborn, independent core. That core was the Kingdom of Kandy, and its survival for more than two centuries against two successive European powers is one of the more remarkable stories in the history of colonial-era Asia.
Retreating to the hills
The Kingdom of Kandy formally emerged in the late 15th century as Sinhalese power fragmented following the decline of the earlier medieval kingdoms. When the Portuguese arrived on the coast in 1505 and gradually took control of the lowland Kingdom of Kotte, Kandy became the last independent Sinhalese stronghold, protected by a genuinely formidable natural barrier: dense forest, steep mountain passes, and a climate that made sustained military campaigns brutal for outsiders.
The Portuguese tried repeatedly to subdue Kandy and repeatedly failed, losing entire armies in the mountain passes. The kingdom's rulers became skilled at a strategy that would serve them for two hundred years: retreat, let the terrain and the climate do the fighting, and negotiate from strength once the invader was exhausted.
Inviting in the Dutch, regretting it
In the early 17th century, King Senarat and later his son Rajasinha II sought Dutch help to expel the Portuguese, offering trade concessions in exchange for military support. The Dutch obliged - and then simply took over the coastal territory the Portuguese had held, rather than returning it to Kandy as promised. The kingdom had swapped one coastal occupier for another, a pattern that would repeat with the British a century and a half later.
It was during Rajasinha II's long reign that the English sailor Robert Knox and his father were shipwrecked and taken captive, giving the world one of its most detailed contemporary accounts of Kandyan life.
Nineteen years in captivity
In November 1659, the ship Ann, blown off course, put in near Trincomalee. Knox spent 19 years on Ceylon after being taken prisoner by King Rajasimha II, along with his father and the rest of the crew. Robert Knox found that he was one of 16 men from the crew held captive by the Kandyan ruler, who split them up and billeted them in different villages rather than imprisoning them in the conventional sense.
Knox was never enslaved in the way that word implies today. He built himself a modest house and cultivated a garden, ate the food of the country, and made a living peddling knitted caps while lending paddy to his fellow villagers. He learned Sinhala fluently and observed Kandyan society closely for nearly two decades. In 1679, he finally escaped with one companion, reached a Dutch settlement on the north-west coast, and was able to return to England in 1680. The book he wrote about his captivity, An Historical Relation of the Island Ceylon, remains one of the essential primary sources for understanding 17th-century Kandy - written by a man who, by his own account, held no lasting grudge against his captors.
A splendid, walled-off capital
The city of Kandy itself was built to reflect divine and royal order, centred on the Temple of the Sacred Tooth Relic. Successive kings expanded the palace complex, built the artificial lake at the city's heart, and endowed the temples that still define Kandy's skyline. Because the kingdom was never conquered by the Portuguese or Dutch, its courtly traditions, dance, architecture, craftsmanship and Buddhist ritual life developed with a continuity that the lowlands - repeatedly disrupted by colonial rule - could not maintain. Much of what is now considered "classical" Sri Lankan culture is, more precisely, Kandyan culture.
The fall
The end came from within as much as from outside. The kingdom's last four rulers, the Nayakkar dynasty, were of South Indian, Telugu-speaking origin, having arrived through royal marriage alliances - ruling Kandy from 1739 to 1815 while remaining significant patrons of Sinhala Buddhism. The final king, Sri Vikrama Rajasinha, faced growing resentment from his own chiefs, some of whom saw an opportunity in the British presence on the coast.
On 18 February 1815, near the village of Medamahanuwara, the king was captured - taken prisoner by his own chiefs and handed over to British forces. Seventeen days later, on 2 March 1815, the British Governor Sir Robert Brownrigg and the chiefs of the Kandyan Kingdom gathered in the Royal Audience Hall beside the Temple of the Tooth and signed the Kandyan Convention. Under its terms, Kandy was annexed to Britain's other holdings in Ceylon, and the king was deposed, his sovereignty vested in the British crown - though notably, it was the Kandyan chiefs themselves who had invited British intervention against their unpopular king, and the convention upheld many of their traditional rights and powers in exchange.
Sri Vikrama Rajasinha was exiled to Vellore Fort in India, where he died in 1832, never returning home. It marked the end of an unbroken line of Sri Lankan monarchy stretching back, by traditional reckoning, well over two thousand years.
What remains
Walk through Kandy today - past the lake the last kings built, into the Temple of the Tooth, through the carved wooden pillars of the Magul Maduwa audience hall where the Convention itself was signed - and you are walking through the physical remains of the only Sri Lankan kingdom that two European empires tried and failed to conquer by force. It fell, in the end, not to an army, but to a signature.