In 1510, Shaybani Khan was in Herat. At this time, Ismail I, having learned about the failures of Shaybani Khan in the battle against the Hazaras, invaded Western Khorasan and began to rapidly advance towards Herat. Shaybani Khan did not have a strong army at his disposal. During the military campaign against the Hazaras, he lost most of his cavalry. The main army was stationed in Mawarannahr, so he, having consulted with his emirs, hastened to hide behind the walls of Merv. Safavid troops captured Astrabad, Mashhad, and also Sarakhs. All Shaybani's emirs who were in Khorasan, including Jan Wafa, fled from the Safavid-Qizilbash army and arrived to Merv. Shaybani Khan sent a messenger to Ubaydulla Khan and Muhammad Timur Sultan for help. Meanwhile, Shah Ismail surrounded Merv and besieged the city for a whole month, but to no avail. Therefore, in order to lure the Khan out of the city, he resorted to a feigned retreat.