Jafar Khan then crowned himself as the new Zand king in Isfahan. At the same time, the Qajar warlord Agha Mohammad Khan marched towards Isfahan. Jafar Khan then sent his men to stop his advance towards the city, but they withdrew at Qum without even putting any resistance. Jafar Khan then sent an even larger Zand army towards Agha Mohammad Khan, who defeated the army near Kashan. Jafar Khan then fled to Shiraz. Agha Mohammad afterwards arrived to Isfahan, where he discovered what was left of the Zand treasure and Jafar Khan's harem. The Qajar troops then looted the city.