In 1679, the
5th Dalai Lama appointed the lama of the
Tashilhunpo Monastery, the
Koshut Galdan Tsewang (), as the commander of the Tibeto-Khoshut expedition to Ladakh. He is said to have done so against the advice of his prime minister not to send the expedition. Galdan Tsewang first secured his flanks when he made a treaty with Raja Kehri Singh of
Bashahr, granting him trade rights with Tibet. Galdan Tsewang's first campaign resulted in the defeat of the Ladakhi army led by Shakya Gyatso (, at Khan-dMar. The following year, he defeated the Ladakhis again at
Chang La (
Byan-la) and occupied the country with the exception of the fortresses of
Basgo, and
Tinggmosgang, which held out against the Tibetan attacks for the next three years. The stalemate was broken with the
Mughal Empire's intervention in the war. Kashmir was a Mughal province at this time and included Ladakh in its
sphere of influence. In 1683, an army led by Fidai Khan, son of governor Ibrahim Khan of Kashmir, defeated the Tibeto-Khoshut army and lifted the siege of
Basgo, continuing the pursuit until
Lake Pangong. The Kashmiris helped restore Ladakhi rule on the condition that a mosque be built in
Leh and that the Ladakhi king convert to Islam. The Mughals retreated after signing a treaty with the Ladakhis. Kashmiri historians assert that, after this, the Ladakhi king converted to Islam in return. However, the Ladakhi chronicles do not mention such a thing and the Ladakhi people refute it. The king agreed to give tribute to the Mughals in return for their help. Johan Eleverskog writes that in his struggle for power over Tibet, the
Fifth Dalai Lama employed fear and violence over the Tibetan territories. == Treaty of Tingmosgang ==