From Wikipedia: en.wikipedia.org/wiki/Sultan_Ahmed_Mosque
The Sultan Ahmed Mosque (Turkish: Sultanahmet Camii) is a historical mosque in Istanbul, the largest city in Turkey and the capital of the Ottoman Empire (from 1453 to 1923). The mosque is one of several mosques known as the Blue Mosque for the blue tiles adorning the walls of its interior. It was built between 1609 and 1616, during the rule of Ahmed I. Like many other mosques, it also comprises a tomb of the founder, a madrasah and a hospice. The Sultan Ahmed Mosque has become one of the greatest tourist attractions of Istanbul.
After the humiliating Peace of Zsitvatorok and the unfavourable result of the wars with Persia, Sultan Ahmed I decided to build a large mosque in Istanbul to placate Allah. This would be the first imperial mosque in more than forty years. Whereas 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. This provoked the anger of the 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 the 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 foundations, the vaults and the undercrofts of the Great Palace. Several palaces, already built on the same spot, had to be bought (at considerable price) and pulled down, especially the palace of Sokollu Mehmet Paşa, and large parts of the Sphendone (curved tribune with U-shaped structure of the hippodrome).
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 appointed his royal architect Sedefhar Mehmet Ağa, a pupil and senior assistant of the famous architect Sinan as the architect in charge of the construction. The organization of the work was described in meticulous detail in eight volumes, now in the library of the Topkapı Palace. The opening ceremonies were held in 1617 (although the gate of the mosque records 1616) and the sultan was able to pray in the royal box (hünkâr mahfil). But the building wasn't finished yet in this last year of his reign, as the last accounts were signed by his successor Mustafa I.
The design of the Sultan Ahmed Mosque is the culmination of two centuries of both Ottoman mosque and Byzantine church development. It incorporates some Byzantine 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 has ably synthesized the ideas of his master Sinan, aiming for overwhelming size, majesty and splendour, but the interior lacks his creative thinking.