After the invasion of Baghdad by the Safavid dynasty in 1508, Abu Hanifa mosque and school were destroyed and abolished, due to sectarian conflicts that the Safavids had. The Ottomans invaded Baghdad in 1534 and replaced the Shi'ite Safavid with the Sunni Ottoman rule. Sultan Suleiman the Magnificent first visited, after invading Iraq, Najaf and Karbala. And then, he visited the abolished mosque of Abu Hanifa and ordered to rebuild it and recover all the damages. Along with recovering the mosque, they also added new features to it, like a minaret, a hall, a bathroom, from 50 to 140 shops and the dome that they rebuilt was a dome that was never seen like it before. They also built a square fortress around the mosque and a watchtower. The fortress was armed with 150 soldiers with different military equipment.
