partly preserved today. It was designed by Abu Zayd Abd al-Rahman ibn Sulayman al-Laja'i and completed on November 20, 1361 (21 Muharram 763 AH), as recorded by an original inscription. It features a large astrolabe with a diameter of 71 cm, which is embedded into a wooden structure in the corner of the room, but its mechanism is no longer present.The galleries around the sahn were also rebuilt or repaired in 1283 and 1296–97, while at the entrance from the courtyard to the prayer hall (leading to the central nave of the mihrab), a decorative wooden screen, called the anaza, was installed in 1289 and acted as a symbolic "outdoor" or "summer" mihrab for prayers in the courtyard. The stucco decoration on the entrance arch itself, however, dates from much later. At the central outer entrance to the courtyard from the north, the cupola ceiling over the entrance vestibule of the gate called Bab al-Ward ("Gate of the Rose") was redecorated with carved stucco in 1337. The richly-sculpted archway on the inner side of the gate also dates from this time.A number of ornate metal chandeliers hanging in the mosque's prayer hall date from the Marinid era. Three of them were made from church bells which Marinid craftsmen used as a base onto which they grafted ornate copper fittings. The largest of them, installed in the mosque in 1337, was a bell brought back from Gibraltar by the son of Sultan Abu al-Hasan, Abu Malik, after its reconquest from Spanish forces in 1333. The mosque's library was officially founded by Sultan Abu Inan in 1349 (750 AH), as dated by an inscription over its doorway. This first Marinid library was located at the mosque's northeastern corner (as opposed to the library's current southern location). In 1361, Sultan Abu Salim added a room to it, which was built above and over the adjacent street, and dedicated to readings of the Quran. Saadian and Alaouite period (16th-century to modern era) The Saadians embellished the mosque by adding two prominent pavilions to the western and eastern ends of the courtyard, each of which sheltered a new fountain. The Saadian sultan Ahmad al-Mansur was responsible for building the first pavilion to the east in 1587–88, while the western pavilion was added by his grandson Abdallah al-Ghalib II in 1609. The pavilions emulate the ones in the Court of Lions of the Alhambra palaces (in