In the history of the Iberian Peninsula, a taifa (from Arabic: طائفة ṭā'ifa, plural طوائف ṭawā'if) was an independent Muslim-ruled principality, usually an emirate, though there was one oligarchy, of which a number were formed in Al-Andalus (Moorish Iberia) after the final collapse of the Umayyad Caliphate of Córdoba in 1031.
The origins of the taifas must be sought in the administrative division of the Umayyad Caliphate of Córdoba, as well in the ethnic division of the elite of this state, divided among Arabs, the more numerous Berbers, Iberian Muslims (known as Muladíes – a significant majority) and the Eastern European former slaves.
During the late 11th century, when the First Crusade waves were carving out their territories in the Jerusalem area, the Christians of the northern Iberian peninsula set out to take over the Muslim territories. The caliphate of Cordova, at this time among the richest and most powerful states in Europe, underwent civil war, known as fitna. As a result, it "broke into taifas, small rival emirates fighting among themselves."
However, the political decline and chaos was not immediately followed by cultural decline. Intense intellectual and literary activity continued in some of the larger taifas.
There was a second period when taifas arose, toward the middle of the 12th century, when the Almoravid rulers were in decline.
During the heyday of the taifas, in the 11th century and again in the mid 12th century, their emirs (rulers) competed among themselves, not only militarily but also for cultural prestige. They tried to recruit the most famous poets and artisans.