Begun by Valide Safiye, mother of Mehmet III, in 1597, the foundations of this mosque were laid at the water's edge in a neighborhood slum whose inhabitants had to be paid to move out. Designed by the architect Da'ud Aga, a pupil of Sinan, the Yeni Camii has become a defining feature of Istanbul's skyline.

The building of the mosque dragged on for over 40 years due to water seepage, funding problems, embezzlement, and the death of the sultan, which temporarily shut down operations completely. The mosque was completed by another queen mother, Valide Sultan Turhan Hattice, mother of Mehmet IV, who is buried in the valide sultan's tomb, or türbe, in the courtyard.

The mosque is part of a complex that included at one time a hospital, primary school, and public bath. The Misir Çarsisi, or Egyptian Spice Market, was actually constructed as part of the complex. In the open space formed by the inner "L" of the Spice Market and the northeastern-facing side of the mosque are stalls selling garden and pet supplies, a busy and shaded tea garden, and some street vendors. At the far (northwestern) end of the mosque on the opposite corner is the türbe, housing, in addition to the Valide Sultan, the remains of sultans Mehmet IV, Mustafa II, Ahmet III, and Mahmut I.

Opposite the türbe is the house of the mosque's astronomer, or muvakkithane, from where the position of the sun would be monitored to establish the times of the five daily prayers. Just behind the muvakkithane is a ramp leading up to the entrance of the royal loge, or private prayer room. The loge is best viewed from inside the mosque; enjoying a view of the sea, it was richly decorated by tiles, a dome, a vaulted antechamber, and a private toilet.