When the Abbasid dynasty moved the capital of the Islamic Empire to Baghdad from Damascus in 762 AD, of course they needed a lot of new buildings to make it beautiful. They did build a lot of lovely buildings. But because the modern city of Baghdad is right on top of the Abbasid city, there's not much left of medieval Baghdad for us to see.
At Samarra, the caliph Al-Mutawakkil built a great mosque in 847 AD. When it was built, the Great Mosque of Samarra was the largest mosque in the world. It was built out of baked brick. The picture here shows the minaret of the Great Mosque of Samarra. The minaret is 52 meters high, and you get up to the top to give the call to prayer by climbing a long spiral ramp that goes all the way up to the top. The big mosque that went with this minaret is mostly destroyed today, but it was a lot like the earlier mosque at Kairouan, only bigger. It had a big open courtyard, with three rows of columns going around it, just like Kairouan, and a big covered prayer hall, with 17 aisles. Artists covered the walls of the prayer hall with glittering mosaics made of dark blue glass.
This was a Sunni mosque, and the point was to overshadow the Shiite mosques that were already in Iraq, to make the point that the Sunnis were in charge and not the Shiites. Right after he built this mosque at Samarra, the Abbasid caliph al-Muttawakkil destroyed the most holy Shiite mosque at Karbala.