Mashhad was retaken by the Shah Abbas after a long and hard struggle, defeating the Uzbeks in a great battle near Herat as well as managing to drive them beyond the Oxus River. Shah Abbas I wanted to encourage Iranians to go to Mashhad for pilgrimage. He is said to have walked from Isfahan to Mashhad. During the Safavid era, Mashhad gained even more religious recognition, becoming the most important city of Greater Khorasan, as several madrasah and other structures were built beside the Imam Reza shrine.