sentences:  Initially a client kingdom of the Kingdom of Kotte, Kandy gradually established itself as an independent force during the tumultuous 16th and 17th centuries, allying at various times with the Jaffna Kingdom, the Madurai Nayak dynasty of South India, Sitawaka Kingdom, and the Dutch colonizers to ensure its survival.From the 1590s, it was the sole independent native polity on the island of Sri Lanka and through a combination of hit-and-run tactics and diplomacy kept European colonial forces at bay, before finally succumbing to British colonial rule in 1818.The kingdom was absorbed into the British Empire as a protectorate following the Kandyan Convention of 1815, and definitively lost its autonomy following the Uva Rebellion of 1817.