and Landmarks, divides this period into three distinct phases: Badr describes the period between 749 and 974 as a push-and-pull between peace and political turmoil, while Medina continued to pay allegiance to the Abbasids. From 974 to 1151, Medina was in a liaison with the Fatimids, even though the political stand between the two remained turbulent and did not exceed the normal allegiance. From 1151 onwards, Medina paid allegiance to the Zengids, and the Emir Nuruddin Zangi took care of the roads used by pilgrims and funded the fixing of the water sources and streets. When he visited Medina in 1162, he ordered the construction of a new wall that encompassed the new urban areas outside the old city wall. Zangi was succeeded by Salahuddin al-Ayyubi, founder of the Ayyubid dynasty, who supported Qasim ibn Muhanna, the Governor of Medina, and greatly funded the growth of the city while slashing taxes paid by the pilgrims. He also funded the Bedouins who lived on the routes used by pilgrims to protect them on their journeys. The later Abbasids also continued to fund the expenses of the city. While Medina was formally allied with the Abbasids during this period, they maintained closer relations with the Zengids and Ayyubids. The historic city formed an oval, surrounded by a strong wall, high, dating from this period, and was flanked with towers. Of its four gates, the Bab al-Salam ("The Gate of Peace"), was remarked for its beauty. Beyond the walls of the city, the west and south were suburbs consisting of low houses, yards, gardens and plantations. Mamluk Sultanate of Cairo After a brutal long conflict with the Abbasids, the Mamluk Sultanate of Cairo took over the Egyptian governorate and effectively gained control of Medina. In 1256, Medina was threatened by lava from the Harrat Rahat volcanic region but was narrowly saved from being burnt after the lava turned northward. During Mamluk reign, the Masjid an-Nabawi caught fire twice. Once in 1256, when the storage caught fire, burning the entire mosque, and the other time in 1481, when the masjid was struck by lightning. This period also coincided with an increase in scholarly activity in Medina, with scholars such as Ibn Farhun, Al-Hafiz Zain al-Din al-'Iraqi, Al Sakhawi and others settling in the city. The striking iconic Green Dome also found its beginnings as a cupola built under Mamluk Sultan al-Mansur Qalawun as-Salihi in