the city as a center for Sunni intellectualism, enabling them to maintain relative independence from Fatimid religious authority. In 1069, large sections of the mosque, particularly the northern wall, were destroyed in a fire as a result of an uprising by the city's residents against the Fatimids' Berber army who were garrisoned there. Seljuk and Ayyubid era The Sunni Muslim Seljuk Turks gained control of the city in 1078 and restored the nominal rule of the Abbasid Caliphate. The Seljuk ruler Tutush () initiated the repair of damage caused by the 1069 fire. In 1082, his vizier, Abu Nasr Ahmad ibn Fadl, had the central dome restored in a more spectacular form; the two piers supporting it were reinforced and the original Umayyad mosaics of the northern inner façade were renewed. The northern riwaq ('portico') was rebuilt in 1089. The Seljuk atabeg of Damascus, Toghtekin (), repaired the northern wall in 1110 and two inscribed panels located above its doorways were dedicated to him. In 1113, the Seljuk atabeg of Mosul, Sharaf al-Din Mawdud (), was assassinated in the Umayyad Mosque. As the conflict between Damascus and the Crusaders intensified in the mid-12th century, the mosque was used as a principal rallying point calling on Muslims to defend the city and return Jerusalem to Muslim hands. Prominent imams, including Ibn Asakir, preached a spiritual jihad ('struggle') and when the Crusaders advanced towards Damascus in 1148, the city's residents heeded their calls; the Crusader army withdrew as a result of their resistance. During the reign of the Zengid ruler Nur ad-Din Zangi, which began in 1154, a second monumental clock, the Jayrun Water Clock, was built on his personal orders. It was constructed outside the eastern entrance to the mosque, called Bab Jayrun, by the architect Muhammad al-Sa'ati, was rebuilt by al-Sa'ati following a fire in 1167, and was eventually repaired by his son, Ridwan, in the early 13th century. It may have survived into the 14th century. The Arab geographer al-Idrisi visited the mosque in 1154. Damascus witnessed the establishment of several religious institutions under the Ayyubids, but the Umayyad Mosque retained its place as the center of religious life in the city. Muslim traveler Ibn Jubayr described the mosque as containing many different zawaya (religious lodges) for religious and Quranic studies. In 1173, the northern wall of the mosque was damaged again by the fire and was rebuilt by