Yazdegerd's army was defeated at the Battle of the Oxus River and retreated across the Oxus to Transoxiana. Yazdegerd III had a narrow escape and fled to China. Balkh was occupied by the Muslims, and with this occupation the Persian war was over.