The history of Darjeeling is intertwined with that of Sikkim, Nepal, British India, and Bhutan. Until the early 19th century, the hilly area around Darjeeling was controlled by the Kingdom of Sikkim with the settlement consisting of a few villages of the Lepcha, and Kirati people. The Chogyal of Sikkim had been engaged in unsuccessful warfare against the Gurkhas of Nepal. The territory of Darjeeling and its history goes on back to the ancient Yakthung Laje Limbuwan kingdom. After the Treaty of Sugauli in 1816 CE between the Gurkha king and the East India Company, Darjeeling was ceded to Sikkim through British India. The territory of Yakthung Laje Limbuwan, including Darjeeling, became a "de facto" possession of Sikkim, although it was not ruled by Sikkim but long remained as leasehold land. The Yakthung (Limbu) Kings and Gurkha King concluded the Treaty of Salt and Water in 1774 CE, but it was violated by Gurkha Kings on the Treaty of Sugauli while Limbu rulers were not attended in the treaty. This resulted in the territory between the Arun River and the Teesta River being part of Yakthung Laje Limbuwan.