Shimla (then Simla) came under British control after the Anglo-Gurkha War (1814-1816). The war ended with the Treaty of Sugauli, by which the Gurkhas ceded territories, including the hills around Shimla, to the British. The British initially developed Shimla as a retreat and sanatorium for their troops. Its strategic location in the hills made it suitable for billeting troops, guarding the northern frontier, and as a base for potential campaigns in the region. It later became the summer capital of British India.