After the Peace of Zsitvatorok and the crushing loss in the 1603-1618 war with Persia, Sultan Ahmet I, decided to build a large mosque in Istanbul to reassert Ottoman power. It would be the first imperial mosque for more than forty years. While his predecessors had paid for their mosques with their spoil of war, Ahmet the First had to remove the funds of the Treasury, because he had not gained remarkable victories.
It caused the anger of the ulema, the Muslim jurists. The mosque was built on the site of the palace of the Byzantine emperors, in front of the basilica Ayasofya (at that time, the primary imperial mosque in Istanbul) and the hippodrome, a site of significant symbolic meaning as it dominated the city skyline from the south. Big parts of the south shore of the mosque rest on the foundations, the vaults of the old Grand Palace.
The Sultan Ahmed Mosque has five main domes, six minarets, and eight secondary domes. The design is the culmination of two centuries of Ottoman mosque development. It incorporates some Byzantine Christian elements of the neighboring Hagia Sophia with traditional Islamic architecture and is considered to be the last great mosque of the classical period. The architect, Sedefkâr Mehmed Ağa, synthesized the ideas of his master Sinan, aiming for overwhelming size, majesty and splendour.