June 1859, the Afghans controlled Baghlan and Khunabad, and were within striking distance of Qunduz. Alongside this, Murad Beg's brother, who was imprisoned on an island in the Amu Darya river, successfully escaped and took control of Hazrat Imam, also inviting Azam Khan's forces to occupy the place and opening another front. This dispatchment of forces also captured the Jahangir gun, where it was unsure how it fell into the hands of Qataghan. As the situation developed, Nasrullah Khan instead chose not to attack Afghan Turkestan and instead deployed his forces to quell a rebellion in Hisar. Upon hearing this, the ruler of Kulob withdrew his support of Qataghan. With little outside help except from the ruler of Badakhshan, and the Afghan armies approaching Kunduz, Murad Beg surrendered and gave control of Qataghan to his brother-in-law and fled to Rustaq. Later, Murad Beg moved to Taloqan. However, after Muhammad Zaman Khan was sent against him with a strong force, he fled across the Amu Darya. His brother-in-law sent a message to the Afghan camp at Khanabad and asked for Dost Mohammad's terms, and an Uzbek Amir in the Afghan army named Mir Qilij Khan began gathering the elders of Qataghan into Afzal Khan's camp. When the envoys arrived from Qataghan, they attempted to negotiate for the withdrawal of Afghan forces in exchange for an oath of loyalty. However, Afzal Khan, being in too powerful of a position to give up, affirmed the terms of Nahrin and Khanabad to be garrisoned by Afghan forces. Qunduz had no choice but to accept the terms implicated, and by the end of June 1859, the treaty was formalized. Six hundred Uzbek horsemen loyal to the Afghans were sent to consolidate rule in Qunduz and Afzal Khan arrived later with an escort of horses and Jezailis. A short while later following the treaty, the ruler of Badakshan also tendered his submission to Dost Mohammad Khan and became a tributary to the Afghans. Showdown with Bukhara (1860) Despite the invasion of Qataghan, a Bukharan ambassador remained in Kabul for diplomatic contact with Dost Mohammad Khan. However, after the capture of the Jahangir gun, Nasrullah Khan demanded the gun which was seized by Afzal Khan as plunder from the war with Murad beg. Dost Mohammad Khan refused such demands and on 9 September 1859, the Bukharan ambassador was allowed to return to Bukhara. According to Jonathan Lee,