Another problem was the European occupation of several seaports where in 1681 he retook al-Mamurah ("La Mamora") from the Spanish, in 1684 Tangier from the English, and in 1689 Larache also from the Spanish.
Another problem was the European occupation of several seaports where in 1681 he retook al-Mamurah ("La Mamora") from the Spanish, which he renamed the city al-Mahdiya. Later in 1684 he also conquered Tangier from the English, and in 1689 Larache also from the Spanish.