Barrima Mosque

The Barrima Mosque (also spelled Berrima Mosque; مسجد بريمة, Berber: ⵎⴻⵣⴳⵉⴷⴰ ⴱⴰⵔⵉⵎⴰ) is a mosque in Marrakesh, Morocco, attached to the Kasbah (citadel) and Royal Palace (Dar al-Makhzen) of the city. It was built in the late 18th century by the Alaouite sultan Muhammad ibn Abdallah.

History
Sultan Muhammad ibn Abdallah did not choose a capital for his reign but in practice he based himself in Marrakesh more than any other city. As a result, he carried a number of renovations and constructions within the royal citadel (the Kasbah and Dar al-Makhzen) of the city, including the restoration of the main Kasbah Mosque. However, reportedly because his son Maymun wanted a mosque that was closer to the palace itself, he commissioned another mosque, the Barrima Mosque. This mosque is located on the eastern edge of the Royal Palace grounds and the western edge of the old Mellah (Jewish quarter), near the city gate of the same name, Bab Berrima. The mosque acted as an official royal mosque much like the Lalla Aouda Mosque did for Moulay Isma'il's kasbah and palace in Meknes.

Architecture
Compared to other Moroccan mosques, the Barrima Mosque's form and layout are unusual. Rather than a sahn, the mosque's large square courtyard (measuring 35 by 35 meters) was referred to as a mechouar (an official royal square). Between this and the prayer hall was a vestibule alongside two waiting rooms for the sultan and government officials. The prayer hall, measuring 15 by 25 metres, is smaller than the courtyard and does not follow the usual form of prayer halls in Moroccan mosques: instead of a hypostyle space with rows of arches, it is composed of a large square chamber covered by a cupola resting on 12 columns and of another rectangular space in front of the mihrab (niche symbolizing the direction of prayer). The wooden ceilings of the prayer hall are the most beautifully decorated aspect of the mosque. The mosque had three entrances, of which only the northern one was accessible to the common inhabitants outside the palace. The sultan had his own private entrance, accessible from the palace, which opened next to the mihrab inside the mosque. Its minaret is merely a small tower which does not surpass the height of the nearby walls of the palace (possibly an intentional design to avoid providing a view into the restricted grounds of the palace). The mosque was originally provided with an adjoining madrasa and an ablutions chamber (midha), but these were in ruins by the mid-20th century.