Kutubiyya Mosque

The Kutubiyya Mosque or Koutoubia Mosque (Arabic: جامع الكتبية Arabic pronunciation: [jaːmiʕu‿lkutubijːa(h)]) is the largest mosque in Marrakesh, Morocco. It is located in the southwest medina quarter of Marrakesh, near the Jemaa el-Fnaa market place, and is flanked by large gardens.
The mosque was founded in 1147 by the Almohad caliph Abd al-Mu'min right after he conquered Marrakesh from the Almoravids. A second version of the mosque was entirely rebuilt by Abd al-Mu'min around 1158, with Ya'qub al-Mansur possibly finalizing construction of the minaret around 1195. This second mosque is the structure that stands today. It is an important example of Almohad architecture and of Moroccan mosque architecture generally. The minaret tower, 77 metres (253 ft) in height, is decorated with varying geometric arch motifs and topped by a spire and metal orbs. It likely inspired other buildings such as the Giralda of Seville and the Hassan Tower of Rabat, which were built shortly after in the same era. The minaret is also considered an important landmark and symbol of Marrakesh.
The mosque's name derives from the Arabic word kutubiyyin (كُتُبيين), which means "booksellers". The Koutoubia Mosque, or Bookseller's Mosque, reflects the bookselling trade practised in the nearby souk. At one time as many as 100 book vendors worked in the streets at the base of the mosque.
The mosque is located about 200 metres (660 ft) west of the city's the Jemaa El Fna souq, a prominent market place which has existed since the city's establishment. It is situated on the Avenue Mohammed V, opposite Place de Foucauld. During French occupation, the network of roads was developed with the mosque as the central landmark, in the ville nouvelle. To the west and south of the mosque is a notable rose garden, and across Avenue Houmman-el-Fetouaki is the small mausoleum of the Almoravid emir Yusuf ibn Tashfin, one of the great builders of Marrakesh, consisting of a simple crenelated structure.
In the mosque's esplanade, which backs onto Jemaa el Fna, the ruins of the first Kutubiyya Mosque can be seen. A part of the perimeter of the Ksar al-Hajjar, the original stone fortress built in 1070 by Abu Bakr ibn Umar, the Almoravid founder of the city, was also uncovered on the northern side of the original mosque. Also visible today at the northeast corner of these ruins and in other areas around the adjacent plaza are various remains attributed to the palace of Ali ibn Yusuf, built next to the fortress and completed in 1126, before being demolished by the Almohads to make way for their new mosque. Directly east of the current mosque is a 19th-century walled residence known as Dar Moulay Ali, which now serves as the French consulate.
Also on the same esplanade is a small white domed building, the Koubba (or Qubba) of Lalla Zohra. This is the tomb of Fatima Zohra bint al-Kush (also called Lalla Zohra), a female mystic who died in the early 17th century and was buried here near the mosque.
The city of Marrakesh was founded around 1070 by the Almoravid dynasty to be their capital, but was captured in 1147 by the Almohads under their leader Abd al-Mu'min. While the Almohads decided to make Marrakesh their capital too, they did not want any trace of religious monuments built by the Almoravids, their staunch enemies, as they considered them heretics. They reportedly demolished all the mosques in the city, including the main mosque, the Ben Youssef Mosque, arguing that the Almoravid mosques were not aligned with the proper qibla (direction of prayer).
Since the former Almoravid grand mosque (i.e. the original Ben Youssef Mosque) was already closely integrated into the surrounding urban fabric, it was not practical for the Almohads to rebuild an entirely new mosque with a significantly different orientation on the same site. It's possible that they did not even demolish the mosque but merely left it derelict. The Almohads may have also wished to have the city's main mosque located closer to the kasbah and royal palaces, as was common in other Islamic cities. As a result, Abd al-Mu'min decided to build the new mosque right next to the former Almoravid kasbah, the Ksar el-Hajjar, which became the site of the new Almohad royal palace, located west of the city's main square (what is today the Jemaa el-Fnaa).
The issue of the qibla alignment of the Kutubiyya and other Almohad mosques (and of medieval Islamic mosques generally) is a complex one which is often misunderstood. The justification given by the Almohads for the destruction of existing Almoravid mosques was that their qibla was aligned too far toward the east, which the Almohads judged to be incorrect as they preferred a tradition that existed in the western Islamic world (the Maghreb and al-Andalus) according to which the qibla should be oriented toward the south instead. This alignment was actually further away from the "true" qibla used in modern mosques everywhere today, which points directly towards Mecca (i.e. towards the shortest possible path across the Earth's surface between the mosque and Mecca). Qibla orientations varied throughout the medieval period of Morocco, but the Almohads generally followed an orientation between 154° and 159° (numbers expressed as the azimuth from the true north), whereas the "true" qibla in Marrakesh is 91° (nearly due east). This true qibla was eventually adopted in modern times and is evident in more recent mosques – including the current Ben Youssef Mosque, rebuilt in 1819 with a qibla of 88° (slightly too far north but very close to 91°).
Medieval Muslims did possess sufficient mathematical knowledge to calculate a reasonably accurate "true" qibla. A more easterly qibla orientation (pointing approximately toward Mecca) was already evident in the royal mosque of Madinat al-Zahra (just outside Cordoba) built later in the 10th century, as well as in the orientation of the original Almoravid Ben Youssef Mosque (founded in 1126), estimated to be 103°.
The Almohads, who rose to power after these periods, apparently chose a qibla orientation which they saw as more ancient or traditional. Whether their interpretation of the qibla was a true and rigorously followed directive or a mostly symbolic argument to differentiate themselves from the Almoravids is still questioned by scholars. The Almohad qibla was similar to the qibla orientation of the prestigious Great Mosque of Cordoba and the Qarawiyyin Mosque of Fes, both founded at an early period in the late 8th to 9th centuries. This traditional qibla was based on a saying (hadith) of Muhammad which stated that "What is between the east and west is a qibla" (most likely in reference to his time in Medina, north of Mecca), which thus legitimized southern alignments. This practice may also have sought to emulate the orientation of the walls of the rectangular Kaaba structure inside the Great Mosque of Mecca, based on another tradition which considered the different sides of the Kaaba as being associated with different parts of the Muslim world. In this tradition, the northwest face of the Kaaba was associated with al-Andalus and, accordingly, the Great Mosque of Cordoba was oriented toward the southeast, as if facing the Kaaba's northwestern façade, with its main axis parallel to the main axis of the Kaaba structure (which is oriented from southeast to northwest). This architectural alignment was typically achieved by using astronomical alignments to reproduce the appropriate orientation of the Kaaba itself, whose minor axis is aligned with the direction of sunrise at the summer solstice.
The most commonly accepted chronology of the mosque's construction is the one originally proposed by French scholars Henri Terrasse and Henri Basset during their study of Almohad monuments in the first half of the 20th century, with further refinements by Gaston Deverdun in his 1959 book about Marrakesh. According to this view, Abd al-Mu'min began construction of the first Kutubiyya Mosque in 1147, the same year that he had conquered the city. The date of the first mosque's completion is unconfirmed, but is estimated to have been around 1157, when it is known with some certainty that prayers were conducted in the mosque, as it was in 1157 that a celebrated copy of the Qur'an attributed to the hand of Caliph Uthman, previously kept in the Great Mosque of Cordoba, was transferred here.
A more recent (2022) study by scholars Antonio Almagro and Alfonso Jiménez has argued for a reinterpretation of Arabic historical sources and proposes an alternative chronology. They argue that Abd al-Mu'min's commission of the new mosque was not related to the city's conquest but could have been inspired instead by the transfer of Uthman's Qur'an in 1157. In their view, construction on the mosque began in May 1158 and was completed later that same year, a rapid construction that was possible thanks to the construction methods employed (brick and rammed earth) and to the reuse of materials available nearby.
Although no longer standing today, the first mosque's layout is well-known thanks to modern excavations starting in 1923. The excavated foundations of the mosque, as well as the outline of its mihrab and qibla wall, are still visible today on the second mosque's northwestern side.
Adjoined to the walls of the former Almoravid kasbah, the mosque may have been built on top of some of the former Almoravid palace's annexes and maybe even over a royal cemetery or mausoleum. The new mosque was likely connected to the adjacent royal palace via a passage (sabat) which allowed the Almohad caliph to enter the prayer hall directly from his palace without having to pass through the public entrances (not unlike a similar passage that existed between the Great Mosque of Cordoba and the nearby Umayyad palace). This passage likely passed through the imam's chamber behind the southeastern qibla wall and therefore may have disappeared when the second mosque was built over this area.
At some point, Abd al-Mu'min also transferred to his new mosque the Almoravid minbar of the Ben Youssef Mosque, originally commissioned by Ali ibn Yusuf from a workshop in Cordoba. Modern archeological excavations have also confirmed the existence in the first Kutubiyya Mosque of a near-legendary mechanism which allowed the wooden maqsura (a screen separating the caliph and his entourage from the rest of the crowd during prayers) to rise from a trench in the ground seemingly by itself, and then retract in the same manner when the caliph left. Another semi-automated mechanism also allowed the minbar to emerge and move forward from its storage chamber (next to the mihrab) seemingly by itself. The exact functioning of the mechanism is unknown, but may have relied on a hidden system of counterweights.
The new Almohad mosque, with its objects from Cordoba and its proximity next to the palace, was thus imbued with great political and religious symbolism. It was closely associated with the ruling Almohad dynasty while also making subtle references to the ancient Umayyad caliphate in Cordoba, whose great mosque was a model for much of subsequent Moroccan and Moorish architecture.
It is unclear if the first Kutubiyya Mosque had a minaret, though some historians have suggested that a former bastion or gate of the Almoravid kasbah may have been reused for the mosque's first minaret. Fragments of such a structure are visible today at the northeastern corner of the first mosque. They were identified by French archeologist Jacques Meunié as the remnants of a gate (referred to as Bab 'Ali or Bab 'Ali ibn Yusuf) belonging to the palatial expansion of the Almoravid kasbah by Ali ibn Yusuf. This structure might have been converted into the mosque's first minaret or served as the minaret's base. The remains of this minaret may have been visible even as late as the beginning of the 19th century, when a drawing of the area by Ali Bey el Abbassi appears to show a second tower standing north of the present-day Kutubiyya minaret. Almagro and Jiménez have argued that the remnants visible today belong to the first Almohad minaret and that it was built over a corner tower of the Almoravid fortress rather than a palace gate.
At some point, Abd al-Mu'min decided to build a second mosque directly adjoined to the southeastern (qibla) side of the first mosque. The reasons for this unusual decision are still not fully understood. The most popular historical narrative asserts that Abd al-Mu'min discovered, possibly during its construction, that the initial mosque was misaligned with the qibla (presumably according to Almohad criteria). The second mosque is indeed aligned slightly further to the south, at an azimuth of 159° or 161° from the true north, compared to the 154° alignment of the first mosque, which actually makes the second mosque 5 to 7 degrees further out of alignment with respect to the "true" or modern qibla. Why this slightly different alignment was preferred is unclear; it may be that the first mosque was aligned with the walls of the Ksar el-Hajjar and that this was judged sufficient at the time, but that the alignment of the second mosque more closely matched that of the Tinmal Mosque (an important Almohad religious site) which had been built in the meantime. Other possible motivations for the construction of the second mosque may have been to accommodate a growing population, to make it more impressive by doubling its size, or even as an excuse to make one of the mosques exclusive to the ruling elites while the other was used by the general population.
The construction dates of the second mosque are also not firmly established. One historical source, originally written by Ibn Tufayl and reported by al-Maqqari, claims that Abd al-Mu'min began construction on a mosque in May 1158 (Rabi' al-Thani 553 AH) and that it was completed with the inauguration of the first Friday prayers in September (Sha'ban) of the same year. Because this construction period seems implausibly short, it is likely that construction either began before May 1158 or (perhaps more likely) continued after September 1158.
The minaret of the mosque, which is visible today, is also not conclusively dated. Some historical sources attribute it to Abd al-Mu'min (who reigned up until 1163) while others attribute it to Ya'qub al-Mansur (who reigned between 1184 and 1199). According to French scholar Gaston Deverdun and some later historians, the most likely scenario is that the minaret was begun before 1158 and largely built by Abd al-Mu'min, or at the very least designed on his commission. It is plausible, however, that Ya'qub al-Mansur either finished the work during his reign or that he added the small secondary "lantern" tower at its summit in 1195.
The second Kutubiyya Mosque was built almost identical to the first except for its adjusted orientation. The layout, architectural designs, dimensions and materials used for construction were almost all the same. The only architectural differences are in a few details and in the fact that the second mosque was slightly wider than the first. The mosque's floor plan is also slightly irregular due to the fact that its northern wall is still the old southern wall of the first mosque, which is at a slightly different angle (due to the different qibla orientation).
The Kutubiyya Mosque, and more specifically its minaret, was the forerunner of two other structures built on the same pattern, the Hassan Tower in Rabat (a monumental mosque begun by Ya'qub al-Mansur but never finished) and the Great Mosque of Seville, Spain, whose minaret is preserved as the Giralda. It thus became one of the models for subsequent Moroccan-Andalusian architecture.
It is not known when the first mosque was actually deserted, nor is it known for certain whether it was consciously demolished at some point or simply abandoned and allowed to deteriorate. Many scholars believe that the two mosques most likely coexisted for a time as one large mosque. If true, then the old qibla (southern) wall of the first mosque, which became the northern wall of the second mosque, was probably opened up in many places to allow easy circulation between the old and new buildings. This was only sealed up later, as it is today. Additionally, the mosque's current minaret appears to have been integrated into the fabric of both mosques, as evidenced by the remains of an arcade belonging to the first mosque and still attached to the base of the minaret today.
Deverdun, in his 1959 study of Marrakesh, suggested the possibility that the first mosque was only abandoned after Ya'qub al-Mansur built the new Kasbah, or royal citadel, further south. As part of this citadel, al-Mansur had raised the new Kasbah Mosque, completed in 1190, which subsequently served as the main mosque of the caliph and the ruling elites. This would have thus made the old Kutubiyya less useful – especially the first mosque, which was attached to the former, now abandoned, royal palace. It is also possible that the first Kutubiyya was dismantled in order to reuse its materials in the construction of the new kasbah and its mosque.
Almagro and Jiménez, in their 2022 study, propose that both the first and second mosques continued to operate as one mosque until the 17th century. They suggest that in the second half of the 17th century, when the Saadi dynasty's power collapsed and Marrakesh underwent a period of decline, the mosque was neglected and fell into disrepair. When Marrakesh benefited from a revival in the second quarter of the 18th century, the second part of the mosque was restored and parts of it were rebuilt, but the older section, which was probably more severely ruined, was abandoned instead of restored. At this point, the passages that connected the two sections were sealed off, thus turning the second mosque into its own, stand-alone building, as it appears today.
Little documentation exists about the mosque during the early modern period. Based on stylistic grounds, Almagro and Jimnez argue that the mosque's ornate wood ceilings (particularly over the central nave) date to sometime in the 'Alawi period and after the 17th century, most likely during an 18th-century restoration. In the 19th century, records indicate that the 'Alawi sultans Muhammad IV (r. 1859–73) and Hasan I (r. 1873–94) restored the upper part of the minaret. Further restoration was carried out during the 20th century.
The mosque's minaret is featured in Tower of the Koutoubia Mosque, a painting by Winston Churchill made after the 1943 Casablanca Conference. The mosque and its minaret were restored at the end of the 1990s. In 2016 the mosque was fitted with solar panels, solar water heaters, and energy-efficient LED lights as part of an effort to make state-run mosques more dependent on renewable green energy.
The mosque is still active and non-Muslims are not allowed inside. However, it is possible to visit the Tinmal Mosque, built along the same lines, which is inactive but preserved as a historic site south of Marrakesh.
On 8 September 2023, an earthquake with a magnitude of 6.8 Mw damaged the mosque. Video footage during the earthquake showed the mosque's structure shaking. The building remained standing after the earthquake, but cracks have been observed in the minaret. In March 2024, the mosque reopened after completion of renovation work.
Architectural details of the first mosque and the second mosque are almost identical except for the orientation. Hence, what is true of one holds true for the other, though the first mosque is now only visible as archaeological remains. The mosque is a characteristic Almohad design, and its various elements resemble those of many other mosques from the same period. The mosque's floor plan is a slightly irregular quadrilateral due to the fact that its northern wall corresponds to the former southern wall of the first mosque and its different orientation. The current mosque is roughly 90 metres (300 ft) wide, 57 metres (187 ft) long on its west side, and 66 metres (217 ft) long on its east side. Aside from the minaret, the mosque is generally built in brick, although sandstone masonry is also used for parts of the outer walls. The same materials and construction methods are also evident in the first mosque.
The mosque is located in a large plaza with gardens, and is floodlit at night. The wall on the northern side of the first mosque abutted the old Almoravid fortress wall (the Ksar el-Hajjar). There are eight entrances to the mosque: four on the west side and four on the east side. The eastern side faces the street where book shops were located, hence the name "Booksellers' Mosque". There is a private entrance for the imam on the south side of the mosque, leading to a door on the left side of the mihrab. Historically, the first Kutubiyya Mosque also had a private entrance next to the mihrab which was used by the ruler to enter directly into the maqsura.
The rectangular sahn or courtyard is in the northern part of the mosque. It is 45 metres (148 ft) wide, the same width as the nine central naves, and 23 metres (75 ft) long or deep. There is an ablution fountain at the center of the courtyard. Nowadays trees are also planted in a grid pattern throughout the courtyard. The decoration is otherwise limited to the arches running along the edges of the courtyard, with some of the arches are highlighted with a polylobed molding carved around them.
The interior prayer hall is a hypostyle hall with more than 100 pillars which support rows of horseshoe arches that divide the hall into 17 parallel naves or aisles which run perpendicular to the southern wall, or roughly north to south. The pillars and arches are made of brick covered in white plaster. The nine naves in the middle correspond to the width of the courtyard to the north and run the length of six arches, while the four outermost naves run continuously along the east and west sides of the courtyard (corresponding to the length of four extra arches), thus extending the prayer hall around either side of the courtyard. The naves are all covered by berchla or Moroccan wood-frame ceilings on the inside and sloped green-tiled roofs on the outside.
The mihrab, a niche symbolizing the qibla (direction of prayer), is set in the middle of the qibla wall (the southern wall) of the prayer hall and is a central focus of its layout. The prayer hall has a "T"-plan, in that the central nave aligned with the mihrab and another transverse (i.e. perpendicular) aisle running along the qibla wall are wider than other aisles and intersect each other (thus forming a "T" within the floor plan of the mosque). This layout is found in other Almohad mosques and in all major mosques of the Maghreb for much of the Islamic period; a clear T-plan is present in the 9th-century Great Mosque of Kairouan in Tunisia, for example, and in later Moroccan mosques. In addition to their greater width, the central nave and the southern transverse aisle are architecturally highlighted in other ways. unlike the other naves, The central nave is covered by a series of cupola ceilings instead of a long sloped roof. The central nave, as well as the adjacent nave on either side, is split into bays by five transverse arches (i.e. arches perpendicular to the other arches). The transverse arch right in front of the mihrab, as well as the two parallel arches on either side of the mihrab, have a lambrequin profile instead of a horseshoe profile and their intrados are carved with muqarnas sculpting. Finally, the southern (or qibla) transverse aisle of the mosque is bordered on its north side by an additional row of transverse arches with a polylobed profile, setting it apart from the rest of the mosque. Elsewhere, transverse polylobed or lambrequin arches are also used to demarcate the extensions of the prayer hall on either side of the courtyard from the rest of the mosque.
The southern qibla aisle is further decorated with five elaborate muqarnas cupolas: one in front of the mihrab, one at both southern corners of the prayer hall, and two more in between these (or, specifically, at the southern end of the outermost naves that intersect with the courtyard). Muqarnas consists of honeycomb or stalactite-like sculpting made up of hundreds of small niches arranged in a three-dimensional geometric composition. Although made with the same technique, the exact geometric composition of each muqarnas cupola in the mosque is slightly different. Most of the constituent niches are smooth, but eight-pointed stars are carved in the upper parts of the geometric alcoves.
The mihrab has a form which derives from the style established by the Great Mosque of Cordoba, although with some changes in the decorative elements. It consists of a horseshoe arch opening leading to a miniature chamber covered by an octagonal muqarnas dome. Carved decoration covers the wall surfaces around the mihrab arch. The arch is bordered with a scalloped or polylobed molding inside a rectangular alfiz frame, with rosettes in the upper corners. Above this are five false windows forming a blind arcade, with two of the windows filled with carved arabesques. All of this is surrounded in turn by a frieze of geometric decoration. The sides of mihrab's opening are decorated with six engaged marble columns (three on either side) whose ornately carved capitals are spolia originating from Cordoba in al-Andalus, brought to Marrakesh either by the Almohads or by the Almoravids before them. Two doors also flank the mihrab on either side: the one on the right is for the storage room of the minbar, while the one on the left was used by the imam to enter the mosque. Both doors are also flanked with engaged columns with more spolia capitals from Al-Andalus.
All of these decorative and architectural elements – the muqarnas cupolas, the mihrab decoration, and the hierarchical arrangement of arches – are found in similar form and placement in the Tinmal Mosque, which was built in the same period as the Kutubiyya, and in many later mosques such as the 16th-century Saadian mosques of Bab Doukkala and Mouassine.
The minaret is designed in Almohad style and was constructed in rubble masonry using sandstone. It was historically covered with Marrakshi pink plaster, but in the 1990s, experts opted to expose the original stone work and removed the plaster.
The design consists of a tall square or cuboid shaft, which takes up about four fifths of its height. At the top of this main shaft is an open-air platform that can reached from inside the tower. On top of this is a second, smaller square shaft, capped by a fluted dome. The full height of the minaret tower, from the ground to the top of its finial, is around 77 metres (253 ft). The main shaft measures 55.68 metres (182.7 ft) tall and has a square base measuring 12.81 metres (42.0 ft) per side. The second, upper shaft has a square base measuring 6.88 metres (22.6 ft) per side and its top edge (not including the dome and finial) reaches to a height of around 69.5 metres (228 ft) above the ground.
The minaret's height-to-width ratio is thus slightly over 5-to-1, which marked a shift in minaret design in the Maghreb, as these proportions made the Almohad minaret taller and more slender in comparison with earlier North African examples. The Kutubiyya minaret subsequently became a model for later minarets built in the regions that passed under Almohad influence.
The tower's prominence makes it a landmark structure of Marrakesh, which is maintained by an ordinance prohibiting any high rise buildings (above the height of a palm tree) to be built around it. The mu'azzin traditionally gave the adhan from the four cardinal directions from the platform at the top of the minaret, calling the faithful to prayer.
Many embellishing features of the minaret are also found in other religious buildings in the country, such as a wide band of ceramic tiles near the top and the alternation between different but related motifs on each façade of the minaret. The main shaft is marked by panels of sunken masonry forming blind arches and blind arcades of varying designs, including lambrequin arches and intersecting polylobed arches. These are set within rectangular frames around the tower's windows. Each of the four façades has a different series of these blind arch compositions, but the topmost tier is the same on each façade, featuring a panel of four intersecting polylobed arches.
The surface of the tower once featured polychrome decoration that was painted onto a mortar or plaster coating, highlighting some of the blind arches, niches, and spandrels. Although only traces remain today, they are one of the only surviving examples of such decoration from the Almohad period. The decoration is mostly executed in an ochre yellow over an ochre red background, or otherwise with a dark colour over a light background. In addition to some simple geometric motifs, the most elaborate examples are floral compositions based on a tree-of-life motif. There are also medallions containing stylized Kufic inscriptions with the words al-Mulku Lillah (Arabic: الملک للہ, lit. 'Sovereignty belongs to God') and al-'izzu Lillah (Arabic: العز لله, lit. 'Glory to God').
The white and green tiles near the top of the minaret are fastened by nails onto a wooden framework set into the masonry surface behind them. Forming a mosaic with a simple geometric pattern, this tilework is cited by Jonathan Bloom as the earliest reliably-dated example of zellij in Morocco.
Above this zellij band, the top edge of the minaret's main shaft is crowned by stepped merlons. The smaller, secondary shaft of the minaret, which rises from the platform here, is decorated with polylobed arches around a pair of windows on each of its four façades, which are then surmounted by panels of sebka decoration. Around the corners of the shaft, between these panels, the surfaces are covered in a kind of limewash which is inlaid with a geometric pattern based on an eight-pointed star pattern.
The minaret is topped by a traditional finial (jāmūr), a pole with three spheres decreasing in size towards the top, with the largest being 2 metres (6.6 ft) in diameter. The spheres are made of copper plating riveted together. There is a flag pole next to the copper balls forming the spire, which is used for hoisting the religious green flag of the Prophet, which the mu'azzin does every Friday and on religious occasions.
A popular legend about the orbs, of which there are variations, claims that they are made of pure gold. The legend was originally associated with the minaret of the Kasbah Mosque further south (which has a similar finial), but is nowadays often associated with the Kutubiyya instead. One version of the legend claims that there were at one time only three of them and that the fourth was donated by the wife of Yaqub al-Mansur as penance for breaking her fast for three hours one day during Ramadan. She had her golden jewelry melted down to form the fourth globe. Another version of the legend is that the balls were originally made entirely of gold fashioned from the jewellery of the wife of Saadi Sultan Ahmad al-Mansur.
Inside the main shaft are six rooms in succession, one above the other. The whole tower can be ascended via a wide interior ramp that allowed the mu'azzin to ride a horse to the top. The different arrangements on the exterior façade of the minaret correspond to the positions of the window openings situated at different points along the ascending ramp inside. The chambers inside are also enlivened with varying degrees of decoration and with vault ceilings of different designs. The topmost (sixth) chamber is especially notable for its ornamental ribbed dome ceiling (similar to the domes of the Great Mosque of Cordoba) with muqarnas squinches and geometric patterns. Some of the surfaces of the walls inside the minaret are also carved with various graffiti in the form of architectural and decorative patterns, possibly left behind by artisans and architects who worked on the mosque over many years.
The Kutubiyya Mosque's original minbar (pulpit) was commissioned by Ali ibn Yusuf, one of the last Almoravid rulers, and created by a workshop in Cordoba, Spain (al-Andalus). Its production started in 1137 and is estimated to have taken seven years. It is regarded as “one of the unsurpassed creations of Islamic art”. Its artistic style and quality was hugely influential and set a standard which was repeatedly imitated, but never surpassed, in subsequent minbars across Morocco and parts of Algeria. It is believed that the minbar was originally placed in the first Ben Youssef Mosque (named after Ali ibn Yusuf, but entirely rebuilt in later centuries). It was then transferred by the Almohad ruler Abd al-Mu'min to the first Kutubiyya Mosque and was later moved to the second incarnation of that mosque. It remained there until 1962, when it was moved to the El Badi Palace where it is now on display for visitors.
The minbar is an essentially triangular structure with the hypotenuse side occupied by a staircase with nine steps. It is 3.46 metres (11.4 ft) long, 0.87 metres (2 ft 10 in) wide, and 3.86 metres (12.7 ft) tall. The main structure is made in North African cedar wood, although the steps were made of walnut tree wood and the minbar's base was made with fir tree wood. The surfaces are decorated through a mix of marquetry and inlaid sculpted pieces. The large triangular faces of the minbar on either side are covered in an elaborate and creative motif centered around eight-pointed stars, from which decorative bands with ivory inlay then interweave and repeat the same pattern across the rest of the surface. The spaces between these bands form other geometric shapes which are filled with panels of deeply-carved arabesques, made from different coloured woods (boxwood, jujube, and blackwood). There is a 6 centimetres (2.4 in) wide band of Quranic inscriptions in Kufic script on blackwood and bone running along the top edge of the balustrades. The other surfaces of the minbar feature a variety of other motifs. Notably, the steps of the minbar are decorated with images of an arcade of Moorish (horseshoe) arches inside which are curving plant motifs, all made entirely in marquetry with different colored woods.
Historical accounts describe a mysterious semi-automated mechanism in the Kutubiyya Mosque by which the minbar would emerge, seemingly on its own, from its storage chamber next to the mihrab and move forward into position for the imam's sermon. Likewise, the maqsura of the mosque (a wooden screen that separated the caliph and his entourage from the general public during prayers) was also retractable in the same manner and would emerge from the ground when the caliph attended prayers at the mosque, and then retract once he left. This mechanism, which elicited great curiosity and wonder from contemporary observers, was designed by an engineer from Málaga named Hajj al-Ya'ish, who also completed other projects for the caliph. Modern archaeological excavations carried out on the first Kutubiyya Mosque have found evidence confirming the existence of such a mechanism, though its exact workings are not fully established. One theory, which appears plausible from the physical evidence, is that it was powered by a hidden system of pulleys and counterweights.