The country is also frequently called the Gorkha Kingdom, the source of the term "Gurkha" used for Nepali soldiers. After 1800, the rulers prove unable to maintain firm political control over Nepal. A period of internal turmoil follows, heightened by Nepal's defeat in a war with Britain from 1814 to 1816. Since then Nepal is a de facto British protectorate (which lasts until 1923). Stability is restored after 1846 when the Rana family gains power, entrenched itself through hereditary prime ministers, and reduce the monarch to a figurehead. The Rana regime, a tightly centralized autocracy, pursues a policy of isolating Nepal from external influences. In 1923 Nepal regains full independence.
In 1950 the two leading opposition movements merge into the Nepali Congress. King Tribhuvan flees to newly independent India in 1990 and the congress stages a coup in 1950 against the Rana regime, which leads to the formation of Nepal as a quasiconstitutional monarchy in 1951. The royal family reassumes power and the monarch, assisted by the leaders of fledgling political parties, govern the country. During the 1950s, efforts are made to frame a constitution for Nepal that would establish a representative form of government, based on a British model. Matrika Prasad Koraila is prime minister between 1951 and 1952 and between 1953 and 1955. In 1959 King Mahendra the first democratic elections for a national assembly are held. The Nepali Congress Party, a moderate socialist group, gains a substantial victory in the election. Its leader, Bisheshwar Prasad Koirala, forms a government. 18 months later the king dismisses the government and appoints Tulsi Giri as prime minister. The king promulgates a new constitution in 1962. The new constitution establishes a "partyless" system of panchayats (councils) which the king consideres to be a democratic form of government closer to Nepalese traditions. As a pyramidal structure progressing from village assemblies to a Rastriya Panchayat (National Parliament), the panchayat system enshrines the absolute power of the monarchy and keeps the king as head of state with sole authority over all governmental institutions, including the council of ministers and the parliament.
Mahendra is succeeded by Birendra in 1972. After protest the slightly reformed panchayat system is confirmed in a referendum in 1980. Protests rise again in 1990. These protests are initially dealt with severely, with more than 50 persons killed by police gunfire and hundreds arrested. Later that year the king capitulates and he dissolves the panchayat system, lifts the ban on political parties and releases all political prisoners. Lokendra Bahadur Chand of the Rashtriya Prahatantra Party (National Democratic Party, RPP], followed by Krishna Prasad Bhattarai from the NCP form interim governments. After free and fair elections in 1991 the Nepali Congress wins an absolute majority and forms a government and Girija Prasad Koirala becomes prime minister. After the 1994 elections the Nepal Kamyunist Parti (Ekikrit Marksvadi ra Leninvadi) (Communist Party of Nepal (United Marxist-Leninist], UML) with Man Mohan Adhikari can form a minority government. The leaders of the Maoist United People's Front begin a violent insurgency in 1996. The UML governments are followed by coalition governments led by Sher Bahadyr Deuba (NCP, 1995-1997), Lokendra Bahadur Chand (RPP, 1997), Surya Bahadur Thapa (1997-1998) and Koraila. In 1999 the Nepali Congress Party wins the elections and it can form a government under Bhattarai (1999-2000), Koirala (2000-2001) and Deuba (2001-2002).
In 2001 crown prince Dipendra kils his father and the kings brother Gyanendra is proclaimed king. That year peace talks between the maoists and the government are unsuccesfull and the maoists resume their violent insurgency. The king declares a state of emergency, approved by parliament. He dismisses Deuba in 2002 and retains full control of the army and government, appointing Chand (then non-partisan) prime minister. After demonstrations Chand resigns in 2003 and the non-partisan Surya Bahadur Thapa is appointed prime minister. Negotiations with the maoists are unsuccesful and hostilities are resumed. After protests the king re-appoints Deuba in 2004.
Nepal includes the Kingdom of Mastang, which was since 1380 under alternating suzerainty of Tibet and Jumla (in 1789 replaced by Nepal). The ties to Tibet are ended in 1856, bring Mastang formally under the suzerainty of Nepal. A treaty in 1961 confirms confirms inclusion within Nepal.