Following the Peace of Zsitvatorok (1606) and the unfavourable result of the wars with Persia, Sultan Ahmed I decided to build a huge mosque in Istanbul. It would be the first great imperial mosque to be built in more than forty years.His predecessors had paid for their mosques with their war booty, Sultan Ahmed I had to withdraw the funds from the treasury, because he had not won any notable victories during his time. This provoked the anger of the Ottoman ulema, the Muslim legal scholars.
The mosque was to be built on the site of the palace of the Byzantine emperors, facing the Hagia Sophia (at that time it was most venerated mosque in Istanbul) and the hippodrome, a site of great symbolic significance. Large parts of the southern side of the mosque rest on the foundation and vaults of the Great Palace. Several palaces was already built there, most notably the palace of Sokollu Mehmet Pasha, so these first had to be bought at a considerable cost and pulled down. Large parts of the Sphendone (curved tribune with U-shaped structure of the hippodrome) were also removed to make room for the new mosque. Construction of the mosque started in August 1609 when the sultan himself came to break the first sod. It was his intention that this would become the first mosque of his empire.
He did appoint his royal architect Sedefhar Mehmet Ağa, a pupil and senior assistant of the famous architect Mimar Sinan to be in charge of the Mosque construction. The organization of the work was described in meticulous detail in eight volumes, now found in the library of the Topkapı Palace. The opening ceremonies were held in 1617 . The sultan could now pray in the royal box which called hünkâr mahfil. The building was not yet finished in this last year of his reign, as the last accounts were signed by his successor Mustafa I. Known as the Blue Mosque , Sultan Ahmed Mosque is currently one of the most impressive monuments in the world.