In 1791 the Gurkhas had entered into a commercial treaty with the British and hence, when hard pressed, they applied for assisftance against the Chinese to Lord Cornwallis. In consequence of this Kirkpatrick was despatched to Nepal, and reached Noakote in the spring of 1792, but not till after peace had been concluded. One result of this embassy was the ratification of another commercial treaty on the 1st of March 1792.
In 1795 Rana Bahadur removed his uncle, Bahadur Sah, from the regency, and two years subsequently put him to death. From this time up to 1799 the king perpetrated many outrages, till at length his conduct became so intolerable that he was forced to abdicate in favor of his son, Girvanyuddha Vikrama Sah, who was still an infant. Rana Bahadur once again recovered the throne in 1804, but was assassinated in 1805.
In October 1801 another treaty was signed by the British and Nepalese authorities, and a British resident was sent to the Nepalese court, but was withdrawn in 1803, owing to the conduct of the Nepalese. From this time the Nepalese carried on a system of encroachment and provocation on the frontier, which led to a declaration of war by the British in November 1814. At first the British attacks were directed against the western portion of the Nepalese territory, and under Generals Marly, Wood and Gillespie several disasters were met with. General Gillespie himself was killed while leading an assault on a small fort called Kalunga. General Ochterlony was more successful, and the Gurkhas were driven eastward beyond the Kali river, and began to negotiate for peace. Arms, however, were soon taken up again, and Ochterlony, who was put in command, in January 1816, advanced directly on the capital in the line of the route that is now in use. The Nepalese sued for peace. A treaty was concluded in March, by which the Nepalese relinquished much of their newly acquired territory, and agreed to allow a British residency to be established at Katmandu. In November the raja died, and was succeeded by his infant son, Surendra Bikran Sah, the reins of government being held by General Bhimsena Thapa.
From this time the records for many years furnish little of interest except a history of struggles for office between the Thapa and Pandry factions, and futile attempts at forming combinations with other states in Hindustan against the British.
In 1839 Bhimsenas enemies succeeded in driving him from power, and he committed suicide, or was murdered, in prison.
The Kala Pandry faction then came into power, and there were frequent grave disputes with the British. War, however, was averted by the exertions of the resident, Mr Brian Hodgson.
In 1843 Matabar Singh, the nephew of Bhimsena, returned from exile, soon got into favor at court, and speedily effected the destruction of his old enemies the Kala Pandrys, who were seized and executed in May 1843. At this time mention begins to be made of a nephew of Matabar Singh, Jung Bahadur, the eldest of a band of seven brothers, sons of a kaji or state official. He rose rapidly in the army and in favor at the court, especially with one of the ranis, who was of a most intriguing disposition. In 1844 he was a colonel, and on the 18th of May 1845 killed his uncle, and immediately, with the aid of the rani, took a prominent part in the government. After a short but turbulent interval of intrigue, he got rid of his enemies at one fell swoop, by what is known as the Kot massacre, on the 15th of September 1846. From that time till the day of his death Jung Bahadur was in reality the ruler of Nepal. His old friend, the rani, was banished, and all posts of any consequence in the state were filled by Jung, his brothers and other relatives. In 1850, finding himself securely seated in power, Jung Bahadur paid a visit to England, which made a great impression on him and ever after he professed and proved himself to be a stanch friend of the British. On his return in 1851 he at once devoted himself to reforming the administration of the country, and, whatever may have been the means by which he gained power, it must be allowed that he exercised it so as to prove himself ta great benefactor. In 1853 a treaty for the extradition of criminals was proposed, but it was not ratified till February 1855. In 1854 the Nepalese entered into a war with Tibet, which lasted with varying success till March 1856, when peace was concluded on terms very favorable to Nepal.
In June 1857 intelligence of the mutiny of the native troops in Hindustan reached Nepal, and produced much excitement. Jung Bahadur, in spite of great opposition, stood firm as a friend of the British. On the 26th June 4000 troops were sent off to assist, and these rendered helpful service in the campaign against the mutineers. Jung himself followed in December, with a force of 8,000 men, 500 artillerymen and 24 guns, but too late to be of much use. Many of the mutineers and rebels, including the infamous Nana Saliib, took refuge in the Nepalese tarai, and it was not till the end of 1859 that they were finally swept out of the country. The Nana was said to have died of fever in the tarai, and it is probable that this was the case. His wives and a few attendants resided for many years near Katmandu.
In return for the aid afforded to the British, Jung Bahadur was well rewarded. He was created a G.C.B., and in 1873 a G.C.S.I., honors of which he was not a little proud. The troops employed received food and pay from the day of leaving Katmandu; handsome donations were given to those severely wounded, and to the relatives of the killed; great quantities of muskets and rifles were presented to the Nepalese government; and, to crown all, a large portion of the tarai was restored to Nepal. This ground contains most valuable sal and sisu forests, and yields a revenue of several lakhs of rupees yearly.
Nepal has exercised full independence ever since the ending of British rule in India in 1947.