After the end of Almohad rule in the 1230s, Tlemcen became the capital of one of the three successor states, the Zayyanid Kingdom of Tlemcen (1236–1554). It was thereafter ruled for centuries by successive Zayyanid sultans. Its flag was a white crescent pointing upwards on a blue field. During the Middle Ages, Tlemcen not only served as a trading city connecting the "coastal" route across the Maghreb with the trans-Saharan caravan routes, but also housed a European trading center, or funduk which connected African and European merchants.