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 leaders of a Berber group who had long been settled in the Central Maghreb. Although contemporary chroniclers asserted that they had a noble origin, little is known for sure.
The town of Tlemcen, called Pomaria by the Romans, is about 2,500 feet (760 m) above sea level in fertile, well-watered country.
Tlemcen was an important center under the Almoravid dynasty and its successors the Almohad Caliphate, who began a new wall around the town in 1161.
Yaghmurasen ibn Zayyan (1235–83) of the Bānu ʿabd āl-Wād 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 Sultan of Granada and the King of Castile, Alfonso X. According to Ibn Khaldun, "he was the bravest, most dreaded and honorable 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." 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. Under Yaghmurasen's leadership, and later under Abu Hammu II (1359–89), the kingdom pursued an expansionary policy, pushing towards Fez in the west and into the Chelif valley and Béjaïa in the east.