The attack played a critical role in Christians' seizure of control of the Western Mediterranean, which allowed the First Crusade to be supplied by sea. The Zirid dynasty had its residence here in the 11th century, but was brought to an end by the Norman conquest of the city in 1148. In 1160 the city came under Almohad rule. The role of the capital was taken over by Tunis in the 12th century during the Almohad era, which it remained during the Hafsid Dynasty. Some buildings still exist from the 10th and 11th centuries, such as the Great Mosque and the Casbah, which have helped make the city an important tourist attraction. Later the city was subject to many raids. In 1390 it was the target of the Barbary Crusade, when a French army laid siege to the city but failed to take it. The city was captured by the Spaniards in 1550. A Spanish garrison remained there until 1553. Charles V then offered the charge of the town to the Order of Saint John who ruled Malta but they refused it deeming it too expensive. The emperor ordered the Viceroy of Sicily, Juan de Vega, to dismantle Mahdia despite it being a strategically important stronghold. The demolition tasks were carried out by Hernando de Acuña. Shortly after Mahdia was reoccupied by the Ottomans, but only to live by fishing and oil-works, and the town lost its logistic and commercial importance. It remained under Turkish rule until the 19th century. During the Nazi Occupation of Tunisia in World War II, Mahdia was the site where Khaled Abdelwahhab hid approximately nearly two dozen persecuted Jews. Gare Mahdia forms the southern terminus of the metre-gauge Sahel Metro railway line, which runs from Sousse and Monastir.