Catalonia (Catalan: Catalunya; Spanish: Cataluña; Aranese Occitan: Catalonha), is an Autonomous Community in the Kingdom of Spain. The Autonomous Community of Catalonia covers an area of 32,114 km² with an official population of 7,210,508  from which immigrants represent an estimated 12.3% of the total population. It borders France and Andorra to the north, Aragon to the west, the Valencian Community to the south, and the Mediterranean Sea to the east (580 km coastline). Official languages are Catalan, Spanish, and Aranese.
The capital city is Barcelona. Catalonia is divided into four provinces: Barcelona, Girona, Lleida, and Tarragona. Its territory corresponds to most of the historical territory of the former Principality of Catalonia.
The territory that now constitutes the autonomous community of Catalonia in Spain, and the adjoining Catalan region of France, was first settled during the Middle Palaeolithic. Like the rest of the Mediterranean coast of the Iberian Peninsula, it was colonized by Ancient Greeks and Carthaginians and participated in the pre-Roman Iberian culture. With the rest of Hispania, it was part of the Roman Empire, then came under Visigothic rule after Rome’s collapse. The northernmost part of Catalonia was briefly occupied by the Moorish (Muslim-ruled) al-Andalus in the eighth century, but after the defeat of Emir Abdul Rahman Al Ghafiqiwas’s troops at Tours in 732 local Visigoths regained autonomy, though they voluntarily made themselves tributary to the emerging Frankish kingdom, which gave the grouping of these local powers the generic name Marca Hispanica.
Identifiably Catalan culture developed in the Middle Ages under the hegemony of the Counts of Barcelona. As part of the Crown of Aragon — most historians would say the dominant part — the Catalans became a maritime power, expanding by trade and conquest into Valencia, the Balearic Islands, and even Sardinia and Sicily.
The marriage of Isabella of Castile and Ferdinand II of Aragon (1469) unified Christian Spain; in 1492, the last of al-Andalus was conquered and the Spanish conquest of the Americas began. Political power began to shift away from Catalonia toward Castile.
For some time, Catalonia retained its own laws, but these gradually eroded (albeit with occasional periods of regeneration). Over the next few centuries, Catalonia was generally on the losing side of a series of wars that led steadily to more centralization of power in Spain. The most significant conflict was the War of the Spanish Succession, which began when Carlos II died without a successor in 1700. Catalonia supported the claim of a member of the Austrian branch of the Habsburg dynasty, while the rest of Spain generally supported the French Bourbon claimant, Felipe V. Following the final surrender of Catalan troops on September 11, 1714, Felipe V’s Nueva Planta decrees banned all the main Catalan political institutions and imposed military-based rule over the region.
In the latter half of the 19th century, Catalonia became a center of Spain’s industrialization; to this day it remains the most industrialized part of Spain, rivaled only by the Basque Country. In the first third of the 20th century, Catalonia several times gained and lost varying degrees of autonomy, but Catalan autonomy and culture were crushed to an unprecedented degree after the defeat of the Second Spanish Republic (founded 1931) in the Spanish Civil War (1936–1939) brought General Francisco Franco to power. Even public use of the Catalan language was banned.
After Franco’s death (1975), the Spanish transition to democracy, and the adoption of a democratic Spanish constitution (1978), Catalonia recovered cultural autonomy and some political autonomy. Today, Catalonia is almost universally recognized as one of the most economically dynamic regions of Spain