The Sultan Ahmed Mosque (Turkish: Sultanahmet Camii) is the national mosque of Turkey, and 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. Known as the Blue Mosque, Sultan Ahmet Mosque is one of the most impressive monuments in the world. It is one of the elements included in the complex built by Ahmed I to compete with Ayasofya.
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. During the rule of Ahmed I, Sultan Ahmet mosque was built between 1609 and 1616 CE. Designed by architect Sedefkar Mehmet Aga, the Sultan Ahmet Mosque is considered to be the last example of classical Ottoman architecture.
Mehmet Paşa used large quantities of materials for the construction, in particular stone and marble, draining away supplies for other important works. The layout of the mosque is irregular, as the architect had to take into account the existing constraints of the site. Its major façade, serving as the entrance, faces the hippodrome. The architect based his plan on the Ṣehzade Mosque (1543-1548) in Istanbul, the first major large-scale work of Sinan, with the same square-based symmetrical quatrefoil plan and a spacious forecourt. This prayer hall is topped by an ascending system of domes and semi-domes, each supported by three exedrae, culminating in the huge encompassing central dome, which is 23.5 meters in diameter and 43 meters high at its central point. The domes are supported by four massive piers that recall those of the Selimiye Mosque in Edirne, another masterpiece of Sinan. It is obvious that Mehmet Paşa was overcautious by taking this inflated margin of safety, damaging the elegant proportions of the dome by their oppressive size. These "elephant feet" consist of multiple convex marble grooves at their base, while the upper half is painted, separated from the base by an inscriptive band with gilded words. Seen from the court, the profile of the mosque becomes a smooth succession of domes and semi-domes. The overall effect of the exterior on the visitor is one of perfect visual harmony, leading the eye up to the peak of the central dome.
The façade of the spacious forecourt was built in the same manner as the façade of the Süleymaniye Mosque, except for the addition of the turrets on the corner domes. The court is about as large as the mosque itself and is surrounded by a continuous, rather monotonous, vaulted arcade (revak). It has ablution facilities on both sides. The central hexagonal fountain is rather small in contrast with the dimensions of the courtyard. The monumental but narrow gateway to the courtyard stands out architecturally from the arcade. Its semi-dome has a fine stalactite structure, crowned by a rather small ribbed dome on a tall drum.
A heavy iron chain hangs in the upper part of the court entrance on the western side. Only the sultan was allowed to enter the court of the mosque on horseback. The chain was put there, so that the sultan had to lower his head every time he entered the court in order not to get hit. This was done as a symbolic gesture, to ensure the humility (smallness) of the ruler in the face of the divine.
At its lower levels and at every pier, the interior of the mosque is lined with more than 20,000 handmade ceramic tiles, made at Iznik (the ancient Nicaea) in more than fifty different TULIP designs. The tiles at lower levels are traditional in design, while at gallery level their design becomes flamboyant with representations of flowers, fruit and cypresses. More than 20,000 tiles were made under the supervision of the Iznik master potter Kaşıcı Hasan,and Mustafa Mersin Efendi from Avanos(Cappadocia). However, the price the builders were able to pay for tiles was fixed by the sultan's decree, while tile prices increased over time. As a result, the tiles used later in building were of lesser quality. Their colours have faded and changed (red turning into brown and green into blue, mottled whites) and the glazes have dulled. The tiles on the back balcony wall are recycled tiles from the harem in the Topkapı Palace, when it was damaged by fire in 1574.
The upper levels of the interior are dominated by blue paint, but is of poor quality. More than 200 stained glass windows with intricate designs admit natural light, today assisted by chandeliers. On the chandeliers, ostrich eggs are found that were meant to avoid cobwebs inside the mosque by repelling spiders. The decorations include verses from the Qur'an, many of them made by Seyyid Kasim Gubari, regarded as the greatest calligrapher of his time. The floors are covered with carpets, which are donated by faithful people and are regularly replaced as they become worn out. The many spacious windows confer a spacious impression. The casements at floor level are decorated with opus sectile. Each exedra has five windows, some of which are blind. Each semi-dome has 14 windows and the central dome 28 (four of which are blind). The coloured glass for the windows was a gift of the Signoria of Venice to the sultan. Most of these coloured windows have by now been replaced by modern versions with little or no artistic merit.
The most important element in the interior of the mosque is the mihrab, which is made of finely carved and sculptured marble, with a stalactite niche and a double inscriptive panel above it. The adjacent walls are sheathed in ceramic tiles. But the many windows around it make it look less spectacular. To the right of the mihrab is the richly decorated minber, or pulpit, where the Imam stands when he is delivering his sermon at the time of noon prayer on Fridays or on holy days. The mosque has been designed so that even when it is at its most crowded, everyone in the mosque can see and hear the Imam.
The royal kiosk is situated at the south-east corner. It comprises a platform, a loggia and two small retiring rooms. It gives access to the royal loge in the south-east upper gallery of the mosque. These retiring rooms became the headquarters of the Grand Vizier during the suppression of the rebellious Janissary Corps in 1826. The royal loge (hünkâr mahfil) is supported by ten marble columns. It has its own mihrab, that used to be decorated with a jade rose and gilt  and one hundred Qurans on inlaid and gilded lecterns. 
The many lamps that light the interior was once covered with gold and gems . Among the glass bowls one could find ostrich eggs and crystal balls . All these decorations have been removed or pillaged for museums.
The great tablets on the walls are inscribed with the names of the caliphs and verses from the Quran, originally by the great 17th-century calligrapher Ametli Kasım Gubarım, but they have frequently been restored.
The Sultan Ahmed Mosque is one of the two mosques in Turkey that has six minarets, the other is in Adana. When the number of minarets was revealed, the Sultan was criticized for presumption, since this was, at the time, the same number as at the mosque of the Ka'aba in Mecca. He overcame this problem by paying for a seventh minaret at the Mecca mosque.
Four minarets stand at the corners of the mosque. Each of these fluted, pencil-shaped minarets has three balconies (ṣerefe) with stalactite corbels, while the two others at the end of the forecourt only have two balconies.
Until recently the muezzin or prayer-caller had to climb a narrow spiral staircase five times a day to announce the call to prayer. Today a public address system is used, and the call can be heard across the old part of the city, echoed by other mosques in the vicinity. Large crowds of both Turks and tourists gather at sunset in the park facing the mosque to hear the call to evening prayers, as the sun sets and the mosque is brilliantly illuminated by coloured floodlights.