Apart from Ibn Hud's rebellion of 1232, they ruled until the Tunisian Hafsids established control.The Hafsids' influence in the west rapidly waned, and Ceuta's inhabitants eventually expelled them in 1249.
The Benemerine sultan started the Siege of Ceuta (1418) but was defeated by the first governor of Ceuta before reinforcements arrived in the form of John, Constable of Portugal and his brother Henry the Navigator who were sent with troops to defend Ceuta.
Under King John I of Portugals son, Duarte, the colony at Ceuta rapidly became a drain on the Portuguese treasury. It was soon realised that without the city of Tangier, possession of Ceuta was worthless.
Byzantine governor, Julian (described as King of the Ghomara) who was a vassal of the Visigothic kings of Iberia changed his allegiance after the king Roderic raped his daughter, and exhorted the Muslims to invade the Iberian Peninsula.
Under the leadership of the Berber general Tariq ibn Ziyad, the Muslims used Ceuta as a staging ground for an assault on Visigothic Iberian Peninsula.
, Sabtah) is an 18.5-square-kilometre (7.1 sq mi) Spanish autonomous city on the north coast of Africa, separated by 14 kilometres from Cadiz province on the Spanish mainland by the Strait of Gibraltar and sharing a 6.4 kilometre land border with M'diq-Fnideq Prefecture in the Kingdom of Morocco.
It lies along the boundary between the Mediterranean Sea and the Atlantic Ocean and is one of nine populated Spanish territories in Africa and, along with Melilla, one of two populated territories on mainland Africa.
In 1437, Duarte's brothers Henry the Navigator and Fernando, the Saint Prince persuaded him to launch an attack on the Marinid sultanate.
The resulting Battle of Tangier (1437), led by Henry, was a debacle.
It was part of Cádiz province until 14 March 1995 when both Ceuta and Melilla's Statutes of Autonomy were passed, the latter having been part of Málaga province.