The patron who constructed the Hassan Tower is Yaqub al-Mansur, ruler of the Almohad Caliphate, a Berber Muslim empire in the Maghreb and Iberia. Al-Mansur had made the decision of construct a new fortified imperial capital, called "al-Mahdiyya" or "Ribat al-Fath", on the site of what is now the medina (old city) of Rabat, with new walls extending over a vast area beyond the old Kasbah. This project also included the construction of an enormous mosque for this capital, of which the Hassan Tower was to be the minaret. Construction of the mosque began in 1191, though the year 1195 is sometimes also cited due to historical reports by Mármol claiming that the creation of "Ribat al-Fath" was intended to commemorate al-Mansur's victory at the Battle of Alarcos. (The name "Ribat al-Fath", at any rate, is believed to have been chosen after this victory.)