In 1631, Morocco was reunited by the Alaouite dynasty, who have been the ruling house of Morocco ever since. Morocco was facing aggression from Spain and the Ottoman Empire allies pressing westward. The Alaouites succeeded in stabilising their position, and while the kingdom was smaller than previous ones in the region, it remained quite wealthy. Against the opposition of local tribes Ismail Ibn Sharif (1672–1727) began to create a unified state. With his Jaysh d'Ahl al-Rif (the Riffian Army) he re-occupied Tangier from the English who had abandoned it in 1684 and drove the Spanish from Larache in 1689. Portuguese abandoned Mazagão, their last territory in Morocco, in 1769. However, the Siege of Melilla against the Spanish ended in defeat in 1775.