This is the Sofa (terrace) mosque. It was erected in the Empire style by Mahmud II for the use of a corps called the Sofa Ocağı in the 19th century, before that here stood the Pavilion of the Sword-bearer. During Abdül Mecit is was restored in 1858.
It is situated at the edge of the garden area in the fourth court.