Nepal began to experience some successes in international affairs during the tenure of Jung Bahadur. To the north, relations with Tibet had been mediated through China since Nepal's defeat in 1792, and during the early nineteenth century, embassies had to make the arduous journey to Beijing every five years with local products as a tribute to the Qing Emperor. By 1854, however, China was in decline and had fallen into a protracted period of disturbances, including the Taiping Rebellion (1851–64), revolts by Muslim ethnic groups north of Tibet and war with European powers. The Nepalese mission to Beijing in 1852, just after the death of the sixth Panchen Lama, was allegedly mistreated in Tibet. Because of this slight, the Nepalese government sent a protest letter to Beijing and Lhasa outlining several grievances, including excessive customs duties on Nepalese trade. In 1855 Nepalese troops overran the Kuti and Kairang areas. The Nepalese-Tibetan War lasted for about a year, with successes and failures on both sides, until a treaty negotiated by the Chinese resident and ratified in March 1856 gave Nepalese merchants duty-free trade privileges, forced Tibet to pay an annual tribute of 10,000 rupees to Nepal, and allowed a Nepalese resident in Lhasa. In return, Nepal gave up territorial gains and agreed that it, as well as Tibet, would remain a tributary state subject to China. As the Qing Empire disintegrated later in the century, this tributary status was allowed to lapse, and even Tibet began to shake off its subordination.