Under Moorish rule between 711 and 1262, the city was called "Qādis", whence the modern Spanish name was derived. A famous Muslim legend developed concerning an "idol" ("sanam Qādis") over 100 cubits tall on the outskirts of Cádiz whose magic blocked the strait of Gibraltar with contrary winds and currents; its destruction by Abd-al-Mumin supposedly permitted ships to sail through the strait once more. It also appeared (as "Salamcadis") in the 12th-century Pseudo-Turpin's history of Charlemagne, where it was considered a statue of Muhammad and thought to warn the Muslims of Christian invasion. Classical sources are entirely silent on such a structure, but it has been conjectured that the origin of the legend was the ruins of a navigational aid constructed in late antiquity. Abd-al-Mumin (or Admiral Ali ibn-Isa ibn-Maymun) found that the idol was gilded bronze rather than pure gold, but coined what there was to help fund his revolt. The Moors were finally ousted by Alphonso X of Castile in 1262.