In 1003 Isma'il came back to Transoxiana, where he requested and received assistance from the Oghuz Turks of the Zarafshan valley. They defeated the Karakhanids in several battles, even when Nasr Khan was involved. For various reasons, however, Isma'il came to feel that he could not rely on the Oghuz to restore him, so he went back to Khorasan. He tried to gain Mahmud's support for a campaign to restore the Samanid state, but failed. Some time afterwards, he returned to the Zarafshan valley, where he gained the support of the Oghuz and others. A Karakhanid army was defeated in May 1004, but subsequently the Oghuz deserted Isma'il during another battle, and his army fell apart.
