Taifa of Almería
The Taifa of Almería (, ) was a Muslim medieval Arab kingdom located in what is now the province of Almería in Spain. The taifa originated in 1012 and lasted until 1091. In this period the city of Almería reached its historical splendour under powerful local emirs like Khayran, the first fully independent Emir of Almería and Cartagena, and Abu Yahyà Muhammad ben Ma'n. Almería declared independence of its province from Caliphate of Cordoba around 1012. It remained as an independent kingdom, although several campaigns of the Taifa of Seville diminished its territory in the north. The kingdom was  important due to its strategic location, its harbour, and a developed and very important textile industry, with around five thousand looms, being also a center of silk industry, which originated a very strong commerce with other parts of Europe and which remained until the Muslims were expelled in early 17th century. The emirs of Granada, Seville and Valencia tried to conquer the little Almería kingdom many times. However, it remained independent until the arrival of the Almoravid dynasty, except for a short period of Valencian occupation. The governor sent by the Valencian King, Ma'n, thereafter declared again the independence of  Almería. The kingdom finally was annexed to the Almoravid empire, as were all of the other taifas. List of kings. Slavic rulers. From 1038 to 1041 Almería belonged to the Taifa of Valencia. Symbols. The taifa of Almeria flag was the first flag of Andalusia known to history, and one of the first flags in Europe; it had two green transverse stripes with a white stripe between them. This flag was the precursor of the green and white flag used by several other kingdoms in southern Iberia such as the Kingdom of Granada, which had a red flag as its  main one, but also had various green and white flags for different locations in the kingdom. It has been said that with the defeat of Granada, twenty flags were conquered, eighteen of which were green and white striped. The flag of the taifa of Almeria remained the flag of the Castilian troops in Andalusia, and in the 19th century was adopted as the flag of the Andalusian nationalist movement agitating for regional autonomy within Spain. This flag became the official, current flag of Andalusia after enactment of the statute of autonomy in the early 1980s. When Abu Asbag ibn Arqam , a poet from Guadix who served as vizier of King al-Mu'tasim of Almería, saw the green and white flag on top of the Alcazaba of Almería, he wrote a poem which is regarded as the oldest written document describing a flag in Europe: <poem>The green flag spread over you the wing of bliss, It made its "wišāḥ" of the white morning glow; Its flutter makes it seem to be your foe's heart, Whene'er the wind is striking it full; It guarantees to you good luck in victory: Watch the good omen which forebodes success! (Note : "wišāḥ" is an ornamental belt)</poem>