Jumla District (जुम्ला जिल्ला), is one of the ten districts of the Karnali province of Nepal. This district has Jumla as its headquarters, an area of ; it had populations of 89,427 and 108,921, respectively, in the national censuses of 2001 and 2011. Its territory lies between longitudes 810 28' and 820 18' East, and between latitudes 280 58' and 290 30' North. The Nepali language (then known as Khas language) originated in the Sinja Valley. Sinja was the capital of Khas Kingdom, and the dialect called "Khas Bhasa" is still spoken among that region's people. Jumla was a part of Khasa kingdom during the 11th to 13th century. After 13th-century, Khasa Kingdom collapsed and divided into Baise Rajya (22 principalities) in the Karnali-Bheri region and the Kingdom of Jumla was one of them. The Jumla Kingdom was one of the many kingdoms that dotted Nepal before its reunification by King Prithvi Narayan Shah of Gorkha and later by his younger son Bahadur Shah. The kingdom was founded around 1404 when Baliraja, who married the daughter of the last ruler of the Yatse (Malla) Kingdom, succeeded his father-in-law. It was one of the most powerful kingdoms in western Nepal, being one of the 22 Baise principalities of the Karnali region which had once been part of the larger Yatse Kingdom. After centuries of intermittent warfare, it appropriated the kingdom of Mustang in 1760. In the late 18th century the Jumla kingdom successfully defended itself against the first attack by King Prithivi Narayan Shah, and legend even has it that he got injured in the battle. Later, with the help of the kingdoms surrounding Jumla, Bahadur Shah attacked again and annexed Jumla for the Gorkha kings in 1789. The Jumla kings were Thakuris (Sijapati, Malla, Shahi) like the Gorkha Kings. The Jumla Kingdom belonged to the more extensive pre-unification kingdoms in Nepal. At the height of its power it extended from Mustang in the east to present-day Uttarakhand, a state in modern-day India, territory that the Kingdom of Nepal lost to the East India Company in 1816 during the partition of Nepal.