As the Muslims advanced in Persia, the Persian emperor Yazdjurd moved from province to province until he came to the outlying province Khurasan. It is related that while fleeing to Khurasan in the way he had a dream. In the dream he saw himself and the Holy Prophet of Islam presented before God. Allah decreed that the Muslims should have Persia for a hundred years. The Holy Prophet of Islam wanted that this period should be increased. Allah raised the period to 120 years. The Prophet of Islam represented again and Allah said "Alright let the Muslims have Persia for as much time as you like." When Yazdjurd was to represent his point of view to God, he was awakened by his servants. Yazdjurd felt disconsolate as the dream signified that he and his dynasty were to lose Persia for ever. In Khurasan the emperor Yazdjurd settled at Merv.
When other provinces had fallen, Umar decided that the Muslims should launch the attack against Khurasan and drive the emperor out of the country. Urnar appointed Ahnaf bin Qais to the chief command in the campaign against Khurasan Ahnaf bin Qais accordingly started with his army from Isfahan. From Isfahan two routes led to Khurasan. The main highway was via Rayy and Nishapur. The other route which was less frequented led to Herat by passing Nishapur, and then to Merv. Ahnaf chose to follow the less frequented route.
On the march to Herat the first encounter took place at Tabas. After a feeble resistance the Persian garrison surrendered.
The next encounter took place at Tun. Here too the Persian garrison surrendered.
On reaching Herat, the Muslim army besieged the town. Details of the campaign are not known. It is recorded in contemporary histories that the Persians put up stiff resistance but they were defeated and laid down arms. Herat was occupfed by the Muslims and Ahnaf stayed there for some time to reorganise the administration.
From Herat, Ahnaf sent a column against Nishapur. Some resistance was offered but ultimately Nishapur was captured.
From Nishapur the Muslim forces proceeded to Tus and occupied it after overpowering the Persian garrison.
After clearing these pockets the main Persian town of Merv was made as the target. Merv was the capital of Khurasan and here Yazdjurd held his court. On hearing of the Muslim advance, Yazdjurd left for Balkh. No resistance was offered at Merv, and the Muslims occupied the capital of Khurasan without firing a shot.
Ahnaf stayed at Merv for some time to reorganise the administration and to await further reinforcements from Kufa. In the meantime the Persian forces gathered in considerable strength at Balkh. Yazdjurd sought aid from the neighbouring state Farghana and the Khan of Farghana personally led a Turkish contingent to Balkh.
Having received reinforcements, Ahnaf led the Muslim forces to Balkh. The Muslims had experience of fight with the Persians but they had little experience of war with the Turks. Ahnaf wanted to avoid war with the Turks, and in this connection he thought of ways whereby the Turks should abandon the cause of Yazdjurd. It was reported to Ahnaf that the practice with the Turks were that in the morning three heralds blew bugles and then the Turkish force marched to the battle.
One night Ahnaf hid himself in a safe place outside the Turkish camp. As soon as the Turkish herald came out of the Turkish camp to blow the bugle, Ahnaf overpowered him and killed with his sword. When the second herald came he met the same fate. The third herald also met the same fate. That day the bugles did not blow for the Turkish army. When the bugles did not blow the Khan of Farghana came out of the camp to see what had happened to the heralds. When he saw that all of them were dead he regarded this as a bad omen. At the spur of the moment he decided that the Turks should not involve themselves with the Muslims. He ordered his force to withdraw and march back to Farghana.
When the battle began the Persians charged thinking that they would be supported by their allies the Turks. But the Turks were no longer there. The Muslims counter attacked and the Persian forces found safety in flight across the Oxus to Transoxiana. Balkh was occupied by the Muslims, and with this occupation the Persian war was over. The Muslims had now reached the outermost frontiers of Persia. Beyond that lay the lands of the Turks and still further lay China. The old mighty empire of the Sassanids had ceased to exist.
From Balkh, Ahnaf returned to Merv. From Merv, Ahnaf sent a detailed account of his operations to Umar. He stated that the Muslims were now in occupation of the whole of Persia. He further sought the instructions of the Caliph whether the Oxus should be crossed, and operations carried in Transoxiana.
When Umar received the report of the conquest of Khurasan he held a thanksgiving prayer to God for making the Muslims the heirs to the mighty Persian empire. The Holy Prophet had prophesied that the Muslims would occupy Persia. That prophesy stood fulfilled.
Addessing the people, Umar said:
"Praise be to God Who has made the Muslims the heirs to the mighty empire of Persia. Allah has destroyed the Magian imperialism. Where once the fire-cult dominated there today the Muslims have enforced the cult of the unity of God. God has today chosen you as His instrument. You have to prove yourselves to be worthy of such trust. If you follow the injunctions of God you will prosper. If you falter or waver, God will choose some other people in your place. So that you may prosper let there be no wavering in your faith."
To Ahnaf Umar wrote a letter of appreciation. He exhorted him to run the administration in such a way that the people should come to feel that the Muslim administration was more beneficent to them than the Persian imperial administration. As regards carrying campaigns in Transoxiana, Umar observed with great emphasis and vehemence that the Oxus was not to be crossed on any account.