Before the 9th century, Mashhad was a small village but became prosperous after imam Reza was killed and buried there by Al-Ma'mun the Abbasid caliph. Mashhad turned into a famous town, in the time of Shah IsmailI of the Safavid dynasty (1501) and later Nader Shah of his Empire chose Mashhad as his capital. Mashhad has remained one of Iran's most important cities till this day even with the relocation of the capital to Tehran.