In 1791, the Gorkhas of Nepal while expanding their kingdom westwards across Kali River, invaded and overran Almora, the seat of the Kumaon Kingdom and other parts of Kumaon including Bageshwar. The Gorkhas were defeated by the East India Company in Anglo-Nepalese War in 1814 and were forced to cede Kumaon to the British as part of the Treaty of Sugauli in 1816.