In the history of the Iberian Peninsula, a taifa (from Arabic: طائفة ṭā'ifa, plural طوائف ṭawā'if) was an independent Muslim-ruled principality, usually an emirate or petty kingdom, though there was one oligarchy, of which a number formed in the 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, Berbers, Iberian Muslims (known as Muladíes - the overwhelming majority) and the Eastern European former slaves.
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.