In 1082 the Almoravid leader Yusuf ibn Tashfin founded the city of ("Encampment" in Berber language), which merged with the existing settlement, now called Agadir, and known since as Tlemcen (Tilimsan). Control of Tlemcen probably passed from the Almoravids to the Almohad Caliphate in the mid-twelfth century. However, in the early thirteenth century, 'Abdallah ibn Ghaniya attempted to restore Almoravid control of the Maghreb. In about 1209, the region around Tlemcen was devastated by retreating Almoravid forces, not long before their final defeat by the Almohads at the Battle of Jebel Nafusa in 1210. Despite the destruction of Tlemcen's already-feeble agricultural base, Tlemcen rose to prominence as a major trading and administrative center in the region under the ensuing reign of the Almohads.