The Gorkha army from Nepal invaded Darjeeling in the 1780s, attacked the Sikkimese capital of Rabdentse, and annexed territories up to the Teesta River into Nepal. By 1816 the whole of the area known as British Sikkim belonged to Nepal. After the Anglo-Gorkha War, Nepal ceded one-third of it territories to the British under the 1816 Sugauli Treaty, which included the land area between the Mechi and Teesta Rivers. On 10February 1817, the British returned the land area between the Mechi and Teesta to the Sikkimese Chogyal under the Treaty of Titalia.