# Kingdom of Tlemcen

The Kingdom of Tlemcen or Zayyanid Kingdom of Tlemcen (Arabic: الزيانيون) was a kingdom ruled by the Berber Zayyanid dynasty in what is now the northwest of Algeria. Its territory stretched from Tlemcen to the Chelif bend and Algiers, and at its zenith reached Sijilmasa and the Moulouya River in the west, Tuat to the south and the Soummam in the east.
The Tlemcen Kingdom was established after the demise of the Almohad Caliphate in 1236, and later fell under Ottoman rule in 1554. The capital of the kingdom was Tlemcen, which lay on the primary east–west route between Morocco and Ifriqiya. The kingdom was situated between the realm of the Marinids to the west, centred on Fez, and the Hafsids to the east, centred on Tunis.
Tlemcen was a hub for the north–south trade route from Oran on the Mediterranean coast to the Western Sudan. As a prosperous trading centre, it attracted its more powerful neighbours. At different times the kingdom was invaded and occupied by the Marinids from the west, by the Hafsids from the east, and by Aragonese from the north. At other times, they were able to take advantage of turmoil among their neighbours: during the reign of Abu Tashfin I (r. 1318–1337) the Zayyanids occupied Tunis and in 1423, under the reign of Abu Malek, they briefly captured Fez.$^{:287}$ In the south the Zayyanid realm included the Tuat, Tamentit, and Draa regions which was governed by Abdallah Ibn Moslem ez Zerdali, a sheikh of the Zayyanids.

## History
### Rise to power (13th century)

The Bānu ʿabd āl-Wād, also called the Bānu Ziyān or Zayyanids after Yaghmurasen Ibn Zyan, the founder of the dynasty, were a Berber clan who had long been settled in the Central Maghreb. Although contemporary chroniclers asserted that they had a noble Arab origin, Ibn Zayyan reportedly spoke in Zenati dialect and denied the lineage that genealogists had attributed to him. Yaghmurasen would in fact have responded yessen rabi, which means in Berber "god only knows", to this claim. The town of Tlemcen, called Pomaria by the Romans, is about 806m above sea level in fertile, well-watered country.
Tlemcen was an important centre under the Almoravid dynasty and its successors the Almohad Caliphate, who began a new wall around the town in 1161.
Ibn Zayyan was governor of Tlemcen under the Almohads. He inherited leadership of the family from his brother in 1235. When the Almohad empire began to fall apart, in 1235, Yaghmurasen declared his independence. The city of Tlemcen became the capital of one of three successor states, ruled for centuries by successive Ziyyanid sultans. Its flag was a white crescent pointing upwards on a blue field. The kingdom covered the less fertile regions of the Tell Atlas. Its people included a minority of settled farmers and villagers, and a majority of nomadic herders.
Yaghmurasen was able to maintain control over the rival Berber groups, and when faced with the outside threat of the Marinid dynasty, he formed an alliance with the Emir of Granada and the King of Castile, Alfonso X. According to Ibn Khaldun, "he was the bravest, most dreaded and honourable man of the 'Abd-la-Wadid family. No one looked after the interest of his people, maintained the influence of the kingdom and managed the state administration better than he did." In 1248 he defeated the Almohad Caliph in the Battle of Oujda during which the Almohad Caliph was killed. In 1264 he managed to conquer Sijilmasa, therefore bringing Sijilmasa and Tlemcen, the two most important outlets for trans-Saharan trade under one authority. Sijilmasa remained under his control for 11 years. Before his death he instructed his son and heir Uthman to remain on the defensive with the Marinid kingdom, but to expand into Hafsid territory if possible.

### 14th century

For most of its history the kingdom was on the defensive, threatened by stronger states to the east and the west. The nomadic Arabs to the south also took advantage of the frequent periods of weakness to raid the centre and take control of pastures in the south.
The city of Tlemcen was several times attacked or besieged by the Marinids, and large parts of the kingdom were occupied by them for several decades in the fourteenth century.
The Marinid Abu Yaqub Yusuf an-Nasr besieged Tlemcen from 1299 to 1307. During the siege he built a new town, al-Mansura, diverting most of the trade to this town. The new city was fortified and had a mosque, baths and palaces. The siege was raised when Abu Yakub was murdered in his sleep by one of his eunuchs.
When the Marinids left in 1307, the Zayyanids promptly destroyed al-Mansura. The Zayyanid king Abu Zayyan I died in 1308 and was succeeded by Abu Hammu I (r. 1308–1318). Abu Hammu was later killed in a conspiracy instigated by his son and heir Abu Tashufin I (r. 1318–1337). The reigns of Abu Hammu I and Abu Tashufin I marked the second apogee of the Zayyanids, a period during which they consolidated their hegemony in the central Maghreb. Tlemcen recovered its trade and its population grew, reaching about 100,000 by around the 1330s. Abu Tashufin initiated hostilities against Ifriqiya while the Marinids were distracted by their internal struggles. He besieged Béjaïa and sent an army into Tunisia that defeated the Hafsid king Abu Yahya Abu Bakr II, who fled to Constantine while the Zayyanids occupied Tunis in 1325.
The Marinid sultan Abu al-Hasan (r. 1331–1348) cemented an alliance with Hafsids by marrying a Hafsid princess. Upon being attacked by the Zayyanids again, the Hafsids appealed to Abu al-Hasan for help, providing him with an excuse to invade his neighbour. The Marinid sultan initiated a siege of Tlemcen in 1335 and the city fell in 1337. Abu Tashufin died during the fighting. Abu al-Hasan received delegates from Egypt, Granada, Tunis and Mali congratulating him on his victory, by which he had gained complete control of the trans-Saharan trade. In 1346 the Hafsid Sultan, Abu Bakr, died and a dispute over the succession ensued. In 1347 Abu al-Hasan annexed Ifriqiya, briefly reuniting the Maghrib territories as they had been under the Almohads.
However, Abu al-Hasan went too far in attempting to impose more authority over the Arab tribes, who revolted and in April 1348 defeated his army near Kairouan. His son, Abu Inan Faris, who had been serving as governor of Tlemcen, returned to Fez and declared that he was sultan. Tlemcen and the central Maghreb revolted. The Zayyanid Abu Thabit I (1348–1352) was proclaimed king of Tlemcen. Abu al-Hasan had to return from Ifriqiya by sea. After failing to retake Tlemcen and being defeated by his son, Abu al-Hasan died in May 1351. In 1352 Abu Inan Faris recaptured Tlemcen. He also reconquered the central Maghreb. He took Béjaïa in 1353 and Tunis in 1357, becoming master of Ifriqiya. In 1358 he was forced to return to Fez due to Arab opposition, where he fell sick and was killed.
The Zayyanid king Abu Hammu Musa II (r. 1359–1389) next took the throne of Tlemcen. He pursued an expansionist policy, pushing towards Fez in the west and into the Chelif valley and Béjaïa in the east. He had a long reign punctuated by fighting against the Marinids or various rebel groups. The Marinids reoccupied Tlemcen in 1360 and in 1370. In both cases, the Marinids found they were unable to hold the region against local resistance. Abu Hammu attacked the Hafsids in Béjaïa again in 1366, but this resulted in Hafsid intervention in the kingdom's affairs. The Hafsid sultan released Abu Hammu's cousin, Abu Zayyan, and helped him in laying claim to the Zayyanid throne. This provoked an internecine war between the two Zayyanids until 1378, when Abu Hammu finally captured Abu Zayyan in Algiers.$^{:141}$
The historian Ibn Khaldun lived in Tlemcen for a period during the generally prosperous reign of Abu Hammu Musa II, and helped him in negotiations with the nomadic Arabs. He said of this period, "Here [in Tlemcen] science and arts developed with success; here were born scholars and outstanding men, whose glory penetrated into other countries." Abu Hammu was deposed by his son, Abu Tashfin II (1389–94), and the state went into decline.

### Decline (late 14th to 16th centuries)

In the late 14th and the 15th centuries, the state was increasingly weak and became intermittently a vassal of Hafsid Tunisia, Marinid Morocco, or the Crown of Aragon. In 1386 Abu Hammu moved his capital to Algiers, which he judged less vulnerable, but a year later his son, Abu Tashufin, overthrew him and took him prisoner. Abu Hammu was sent on a ship towards Alexandria but he escaped along the way when the ship stopped in Tunis. In 1388, he recaptured Tlemcen, forcing his son to flee. Abu Tashufin sought refuge in Fez and enlisted the aid of the Marinids, who sent an army to occupy Tlemcen and reinstall him on the throne. As a result, Abu Tashufin and his successors recognized the suzerainty of the Marinids and paid them an annual tribute.$^{:141}$
During the reign of the Marinid sultan Abu Sa'id, the Zayyanids rebelled on several occasions and Abu Sa'id had to reassert his authority.$^{:33–39}$ After Abu Sa'id's death in 1420 the Marinids were plunged into political turmoil. The Zayyanid emir, Abu Malek, used this opportunity to throw off Marinid authority and captured Fez in 1423. Abu Malek installed Muhammad, a Marinid prince, as a Zayyanid vassal in Fez.$^{:287}$$^{:47–49}$ The Wattasids, a family related to the Marinids, continued to govern from Salé, where they proclaimed Abd al-Haqq II, an infant, as the successor to the Marinid throne, with Abu Zakariyya al-Wattasi as regent. The Hafsid sultan, Abd al-Aziz II, reacted to Abu Malek's rising influence by sending military expeditions westward, installing his own Zayyanid client king (Abu Abdallah II) in Tlemcen and pursuing Abu Malek to Fez. Abu Malek's Marinid puppet, Muhammad, was deposed and the Wattasids returned with Abd al-Haqq II to Fez, acknowledging Hafsid suzerainty.$^{:287}$$^{:47–49}$ The Zayyanids remained vassals of the Hafsids until the end of the 15th century, when the Spanish expansion along the coast weakened the rule of both dynasties.$^{:141}$
By the end of the 15th century the Crown of Aragon had gained effective political control, intervening in the dynastic disputes of the amirs of Tlemcen, whose authority had shrunk to the town and its immediate neighbourship.
Tlemcen was captured in 1551 by the Ottomans of the Regency of Algiers, led by Hassan Pasha. The last Zayyanid sultan, Hasan al-Abdallah, escaped to Oran under Spanish protection.$^{:156–157}$ He was baptized and lived under the name of Carlos until his death a few years later. Zayyanid rule thus came to an end.$^{:156–157}$
Under the Ottoman Empire Tlemcen quickly lost its former importance, becoming a sleepy provincial town. The failure of the kingdom to become a powerful state can be explained by the lack of geographical or cultural unity, the constant internal disputes and the reliance on irregular Arab nomads for the military.

## Economy

The city of Tlemcen displaced Tahert (Tiaret) as the main trading hub in the central Maghreb, lying on the west–east route between Fez and Ifriqiya.
Another major route from Oran ran south through Tlemcen to the oases of the Sahara, and onward to the Western Sudan region to the south. The city was directly linked to Sijilmasa, which served as the main northern hub for the trade routes that crossed the desert to the Western Sudanese markets. Oran, a port that the Andalusians had founded in the tenth century to handle the trade with Tahert, came to serve Tlemcen in its trade with Europe. Fez was nearer to Sijilmasa than Tlemcen, but the route to Fez led over the Atlas mountains, while the route to Tlemcen was easier for the caravans. Yaghmurasan made an attempt to capture Sijilmasa in 1257, and succeeded in 1264, holding the town for almost ten years. The Marinids then took Sijilmasa, but most of the trade continued to flow through Tlemcen.
The city of Tlemcen became an important centre, with many schools, mosques and palaces. Tlemcen also housed a European trading centre (funduk) which connected African and European merchants. In particular, Tlemcen was one of the points through which African gold (arriving from south of the Sahara via Sijilmasa or Taghaza) entered the European hands. Consequently, Tlemcen was partially integrated into the European financial system. So, for example, Genoese bills of exchange circulated there, at least among merchants not subject to (or not deterred by) religious prohibitions.
Tlemcen housed several well-known madrasas and numerous wealthy religious foundations, becoming the principal intellectual centre of the central Maghreb. At the souq around the Great Mosque, merchants sold woolen fabrics and rugs from the East, slaves and gold from across the Sahara, local earthenware and leather goods, and a variety of Mediterranean maritime goods "redirected" to Tlemcen by corsairs—in addition to the intentional European imports available at the funduk. Merchant houses based in Tlemcen, such as the al-Maqqari maintained regular branch offices in Mali and the Sudan.

## Architecture

Architecture under the Zayyanids was similar to that found under contemporary dynasties to the west, the Marinids and the Nasrids, continuing western Islamic architectural traditions (also referred to as the "Hispano-Moresque style") and further developing them into the distinctive styles that continued for centuries afterwards. In 1236 Yaghmurasan added minarets to the Great Mosque of Agadir (an older settlement in the area of Tlemcen), previously founded circa 790, and to the Great Mosque of Tlemcen, previously built under the Almoravids in late 11th and early 12th centuries.$^{:42,179}$ Both minarets are made of brick and stone and feature sebka relief decoration similar to the earlier Almohad-built Kasbah Mosque of Marrakesh.$^{:179}$ Yaghmurasan is also credited with rebuilding or expanding the mosque's courtyard and adding another ornamental ribbed dome to its prayer hall. His successor, Abu Sa'id 'Uthman (r. 1283–1304), founded the Mosque of Sidi Bel Hasan in 1296 in Tlemcen.$^{:184}$ The Zayyanids built other religious foundations in and around the city, but many have not survived to the present day or have preserved little of their original appearance.$^{:187}$ Madrasas were a new institution which was introduced to the Maghreb in the 13th century and first proliferated under the Zayyanids and their contemporaries.$^{:168,187}$ The Madrasa Tashfiniya, founded by Abu Tashfin I (r. 1318–1337) and later demolished by French colonial authorities in the 19th century, was celebrated for its rich decoration, especially zellij tile decoration with advanced arabesque and geometric motifs whose style was repeated in some subsequent Marinid monuments.$^{:187}$$^{:526}$
The Zayyanids installed their government in a citadel or kasbah which was previously founded by the Almoravids in what was then Tagrart (now part of Tlemcen). Yaghmurasan developed this into a fortified palatial complex known as the Meshouar (or Mechouar; Arabic: قلعة المشور, romanized: Qal'at al-Mashwār) to which his successors added.$^{:137}$$^{:223}$ Few remains from the Zayyanid period have survived today, but historical sources and archeological excavations have demonstrated the existence of several palaces and residences during that time. Abu Tashfin I built at least three of them, named Dar al-Surur, Dar Abi Fihr, and Dar al-Mulk. Most of the palaces took the form of courtyard buildings, often with a fountain or water basin at their center, gardens, and rich decoration including zellij and carved stucco.$^{:137–144}$$^{:108}$$^{:223–224}$ Some regional characteristics are also attested in their design, such as the placement of a central alcove at the back of a large audience chamber, which has precedents in the Zirid palace of 'Ashir and earlier Fatimid palaces further east.$^{:140}$ One of the royal palaces was reconstructed in 2010–2011 on top of the former ruins, but fragments of original zellij paving have been documented and preserved.$^{:140–142}$ In 1317 Abu Hammu Musa I built the Mechouar Mosque as the official mosque of the palace, though only the minaret and the overall floor plan from the original mosque remain today.$^{:223}$$^{:108–111}$ Another palace, stood next to the Great Mosque of Tlemcen and was known as the Qasr al-Qadim ("Old Palace"), most likely the former residence of Almoravid governors in Tagrart. Yaghmurasan used it as royal residence before his move to the Meshouar in the mid-13th-century, but it appears to have been remained in use under subsequent Zayyanid rulers. It too was partly demolished and replaced by other structures during the 19th century and afterwards.$^{:145–146}$
Attached to the Qasr al-Qadim was the first royal necropolis (or rawda) of the Zayyanids, which remained the burial site of Zayyanid rulers up until the mid-14th century at least.$^{:145}$ After this, the royal necropolis was moved by Abu Hammu II to a new religious complex which he erected in 1361–1362 next to the qubba (mausoleum) of a Muslim saint known as Sidi Brahim. Along with the necropolis, the complex included a mosque and a madrasa, but nearly all of it was in ruins by the 19th century and has since been rebuilt. It remained the site of an important cemetery throughout the later Ottoman period. Excavations have revealed the existence of more rich zellij decoration, of the same style as that of the Tashfiniya Madrasa, which covered some of the tombs.$^{:111–113}$

## Chronology of events

* 1236-1248: Independence war with the Almohad Caliphate
* 1264: Zayyanids conquer Sijilmasa from the Marinids
* 1272: Oujda and Sijilmasa lost to the Marinids
* 1299–1307: Tlemcen besieged by the Marinids
* 1313: Algiers annexed to the Kingdom of Tlemcen
* 1325: Beginning of Zayyanid campaigns toward Hafsid Bejaia and Hafsid Ifriqiya
* 1327: Battle of Tamzezdekt
* 1329: Victory in Battle of er-Rias and Tunis occupied by Zayyanids
* 1337–1348: 1st period of Marinid occupation
* 1352–1359: 2nd period of Marinid occupation
* 1366: Zayyanid-Nasrid victory against Castille
* 1389–1424: Zayyanids recognize Marinid suzerainty
* 1390: Barbary Crusade
* 1423: Capture of Fez by Zayyanid emir Abu Malik and Marinid prince Muhammad installed as Zayyanid vassal in Fez until 1424$^{:287}$$^{:47–49}$
* 1424–1500: Zayyanids recognize Hafsid suzerainty
* 1501: Victory over the Portuguese at Mers-el Kébir
* 1505: Mers el Kebir lost to Spain
* 1507: Victory against Spain by the Zayyanids
* 1509: Oran lost to Spain
* 1510: Siege of Algiers, Spanish occupy area and build fortress of Peñón$^{:365}$
* 1512: Zayyanid emir of Tlemcen swears allegiance to Spain
* 1517: Tlemcen besieged by army of Ottoman commander, Aruj
* 1518: Independence restored after the Spanish victory over Aruj
* 1535: Failure of Spanish expedition to Tlemcen
* 1543: Count Alcaudete of Spain starts an expedition to Tlemcen, deposes Zayyanid ruler, Abu Zayyan III, and installs a vassal ruler, Abu Abdallah Muhammad VI, but the latter is expelled and executed after a few months$^{:155}$
* 1545: Ibn Ghani, chief of Banu Rashid tribe, invades Tlemcen with Spanish allies and installs another puppet ruler, but Ottomans reinstall former Zayyanid ruler after a month, along with an Ottoman garrison$^{:155}$
* 1551: Tlemcen occupied by Algiers, establishment again of Zayyanids on the throne with al-Hasan as ruler
* 1554: Kingdom of Tlemcen becomes an Ottoman protectorate
* 1556: Western Algeria becomes a beylik of the Regency of Algiers by Salah Rais