The Aljama Mosque (great mosque) of the Alhambra was built by Muhammad III in the first year of his reign, 1303.
The haram (prayer hall) had three naves held up by pillars and an octagonal mihrab facing Mecca. It was richly decorated by the sultan with a mimbar for leading prayer and beautiful metallic oil lamps, one of which is preserved in the National Archaeological Museum in Madrid (a repllica can be seen inside the museum of the Alhambra). Part of the floor of the mosque, which remains outside the church to the south, was excavated by Modesto Cendoya in 1922.
In this mosque the sultan would lead mass prayer on Fridays and a cadí would give his jutba (sermon) in the Malakí orthodoxy prevailing in al-Andalus in the 8th century. In 1304 a mimbar inlaid with precious stones was added, with the intention of making it even better than the one put by the Ziri Badis in the 11th century in the great mosque of Granada, which was located where the Church Sagrario de la Catedral in Granada would later be erected in the 18th century.
In al-Andalus the religious domain loyal to the Sunni orthodoxy was followed, and within the sunna (tradition “the ways of the ancestors”). Mystic Sufi music was also introduced to our lands which spread across the whole Islamic empire. In Nasrid Granada there were renowned sufis such as Ibn al-Jatib.
Next to the fountains or mida in the courtyards of the mosques the compulsory ritualistic cleansing was performed. This obligation was so strict that even if there was not any water, it had to be done with clean sand, a rite known in Arab as tayammum. The Koran fully explains how it must be performed.
Yusuf I was murdered in this mosque when praying on the day of the Breaking of the Fast (Fitr). He was killed by a slave consumed by madness, but there is no doubt that there was someone else behind the palatial intrigue that was so common in the Nasrid court.
In order to maintain the mosque, Muhammad III ordered a hamman or bathhouse to be built as well as an adjacent palace. With the profit earned from the bathhouse, part of the expenses of the mosque were covered as was customary in the Islamic world.
From the arrival of the Catholic Monarchs, the Mosque became a Church consecrated to the Virgin. The Muslim building was demolished and built the current Christian temple with invocation to Santa Maria de la Alhambra.