The Almohad caliph Abd al-Mu'min founded a mosque here in 1147, the year he took Marrakesh from the Almoravids, and soon added a second, almost identical one alongside it; that second building, from around 1158, is the mosque that stands today. Its name comes from the Arabic word for booksellers, after the trade that once filled the streets at its base, where as many as 100 book vendors are said to have worked.
The tower is built of sandstone rubble masonry and is a model of Almohad design: a square main shaft 55.68 metres tall on a base of 12.81 metres a side, with an open platform on top and a smaller second shaft capped by a fluted dome. Each of its four faces carries a different sequence of blind arches around the windows, from lambrequin arches to interlacing polylobed ones, while the topmost tier repeats the same panel on all sides. Near the top runs a band of white and green tiles, which the art historian Jonathan Bloom cites as the earliest reliably dated zellij in Morocco. The finial is a pole with three copper spheres, the largest 2 metres across; a popular legend claims they are solid gold. The pink plaster that once covered the stone was removed in the 1990s, though traces of earlier ochre painting, including Kufic medallions and tree-of-life motifs, survive.
Inside the tower, a wide ramp passes six rooms stacked one above another, built broad enough that the mu'azzin could make the climb on horseback. Two later towers followed its pattern: the Hassan Tower in Rabat and the Giralda of Seville. Winston Churchill painted it after the 1943 Casablanca Conference.
The mosque itself is a long brick building, about 90 metres wide, under sloped green-tiled roofs, with four entrances on its west side and four on its east. Its prayer hall is a forest of more than 100 white-plastered pillars carrying horseshoe arches in 17 naves, with five muqarnas cupolas along the qibla wall and a mihrab flanked by marble columns whose capitals came from Cordoba. The building stands in a large plaza with gardens, including a rose garden to the west and south, and is floodlit at night.
On the esplanade toward Jemaa el-Fnaa, the excavated foundations of the first mosque, including the outline of its mihrab, lie open on the northwest side of the present one. Around them are traces of the Ksar al-Hajjar, the stone fortress built in 1070 by the city's Almoravid founder Abu Bakr ibn Umar, and fragments thought to belong to Ali ibn Yusuf's palace. The same esplanade holds the small white domed Koubba of Lalla Zohra, tomb of a female mystic of the early 17th century, and across Avenue Houmman-el-Fetouaki stands the small, plain crenelated tomb of Yusuf ibn Tashfin, the Almoravid emir and one of the great builders of the city.
The mosque's original minbar, a cedar pulpit made in a Cordoba workshop for Ali ibn Yusuf from 1137, was moved in 1962 to the El Badi Palace. Its sides are covered in a marquetry pattern of eight-pointed stars and interlacing bands inlaid with ivory, around carved arabesque panels in boxwood, jujube and blackwood, and its nine steps are decorated with arcades of horseshoe arches.




