An inscriptive plaque above the west entrance, dating from 1247 during the rule of Seljuk Sultan 'Izz al-Din Kaykawus II (1246-1257), attributes the mosque's foundation to Shahab al-Din Ilyas bin Shahab Abu Bakr although construction may have begun earlier under Ala al-Din Kayqubad I (r. 1220-1237). The same inscription names a certain Khusraw as master builder, while the name of Yakub bin Abu Bakr of Malatya is signed as builder on the right flank of the courtyard iwan. The mosque was repaired and extended under Mamluk rule in the second half of the fourteenth century and was restored by the Ottomans in 1649 and in 1903. A comprehensive restoration was completed by the General Directorate of Religious Endowments (Vakiflar Genel Müdürlügü) in 1966.
The mosque has a roughly rectangular plan aligned with qibla on the north-south axis, fifty meters long and thirty-three meters at its widest. It is entered from two muqarnas portals; one at the southern end of the east elevation and a second centered on the west elevation. A third portal, now blocked, leads into a domed bay near the east end of the qibla wall.
Inside, the prayer hall is divided into twelve barrel-vaulted rows with transverse arcades, with an open courtyard of eleven by fifteen meters inserted near the center. A grand iwan occupies the southern side of the courtyard. It is divided into two halves with pointed archway; the inner half is crowned by a semi-vault that descends to meet the low archway leading into the domed sanctuary (maqsura). The west and east sides of the courtyard are occupied by four arcaded bays that are and two and three bays deep, respectively. They are continued for four additional bays to the south, flanking the iwan and the sanctuary on either side.
The taller arcades to the north of the courtyard are four rows deep and six to eight bays wide. They are walled in on the south side, to form a separate prayer hall with a small mihrab. Part of this section, along with the minaret adjoining its western wall, is thought to have been built by the Mamluks in the second half of the fourteenth century. Its wall are made of cut stone and pierced with nine windows; there are no windows on the brick and stone walls of the older halls.
The exterior of the mosque is unadorned with heavy buttresses of varying widths, while the interior is largely plastered white. The east, west and south façades of the courtyard, by contrast, are richly decorated with tile mosaics featuring interlaced geometric motifs and kufic inscriptions made of cobalt blue and black glazed tiles. The four archways on the east and west sides of the courtyard feature floriated kufic panels, with nesih inscriptions framing some arches. The arched portal of the grand iwan, which is framed with multiple bands of geometric motifs in tile mosaic, also bears a damaged inscriptive plaque. The exposed brick interior of the sanctuary feature a variety of brick patterns in the tall zone of transition, which consists of a band of squinches, an octagonal drum with windows and a hexadecagonal ring enveloped by a tile inscription. Turquoise glazed bricks were built into the sanctuary dome to create a spiraling pattern. The historic elements of the courtyard are overshadowed by the protective aluminum siding added to the top of its walls during the 1966 restoration.
Aslanapa, Oktay. Anadolu ilk Türk mimarisi: baslangici ve gelismesi, 38-42. Ankara: Ataürk Kültür, Dil ve Tarih Tüksek Kurumu, 1991.
Bayrak, M. Orhan. Türkiye Tarihi Yerler Kilavuzu, 468-469. Istanbul: Inkilap Kitabevi, 1994.