By XVII century there had arisen a strong necessity to build a mosque, which could compete with Aya-Sofia. Sultan Ahmet, which was then only 19, ordered to begin the construction.
However, one of the main reasons for construction was rather the necessity to improve the position of Ottoman Empire, and not competition with Aya-Sofia, which was somewhat wea-kened after the Treaty of Zsitvatorok by which Sultan Ahmet refused to take contributions from the Austrian Habsburgs, as well as acknowledged their imperial title, thereby considering them as his peers.
The mosque was built by architect Sedefkar Mehmet Aga. Undoubtedly, he took Aya-Sofia as a model, with the same layout of domes. It is believed that it was just him who designed 6 minarets, instead of required four minarets, thereby incurring displeasure of Mecca`s mullahs, and consequently that of Allah, upon Sultan Ahmed, and died of typhus a year after finishing of construction. And in Mecca it was decided to add the seventh minaret to the main mosque of Masjid-al-Haram so that it was again unparalleled.
Though Sultan Ahmet won no war, to say nothing of acknowledging Austrian monarchs as his peers, one of the greatest architectural masterpieces of Muslim world still bears his name – the Mosque of Sultan Ahmet.
The mosque is also sometimes referred to as Blue Mosque because of interior of the temple. During its construction there were used over 20 000 blue and white ceramic tiles brought from Iznikiy shops.