After conducting researches in the 12th century, the Seljuk sultan Ahmed Sanjar ordered a city and shrine to be built on the location, where it stood until its destruction by Genghis Khan and his Mongol army in the 13th century. Although later rebuilt, Mazar stood in the shadow of its neighbor Balkh. During the nineteenth century, due to the absence of drainage systems and the weak economy of the region, the excess water of this area flooded many acres of the land in the vicinity of residential areas causing a malaria epidemic in the region. Thus the ruler of North Central Afghanistan decided to shift the capital of the city of Mazar-i-Sharif.