Catalonia is an autonomous community on the northeastern corner of Spain, designated as a nationality by its Statute of Autonomy. Catalonia consists of four provinces: Barcelona, Girona, Lleida, and Tarragona. The capital and largest city is Barcelona, the second-most populated municipality in Spain and the core of the sixth most populous urban area in the European Union. It comprises most of the territory of the former Principality of Catalonia (with the remainder Roussillon now part of France’s Pyrénées-Orientales, Occitanie). It is bordered by France (Occitanie) and Andorra to the north, the Mediterranean Sea to the east, and the Spanish autonomous communities of Aragon to the west and Valencia to the south. The official languages are Catalan, Spanish, and the Aranese dialect of Occitan.
In the late 8th century, the counties of the March of Gothia and the Hispanic March were established by the Frankish kingdom as feudal vassals across and near the eastern Pyrenees as a defensive barrier against Muslim invasions. The eastern counties of these marches were united under the rule of the Frankish vassal, the count of Barcelona. In the 10th century, the County of Barcelona became independent de facto. In 1137, Barcelona and the Kingdom of Aragon were united by marriage under the Crown of Aragon. The de jure end of Frankish rule was ratified by French and Aragonese monarchs in the Treaty of Corbeil in 1258. The Principality of Catalonia developed its own institutional system, such as courts (parliament), and constitutions, becoming the base for the Crown of Aragon’s naval power, trade and expansionism in the Mediterranean. In the later Middle Ages, Catalan literature flourished. During the last Medieval centuries natural disasters, social turmoils and military conflicts affected the Principality. Between 1469 and 1516, the king of Aragon and the queen of Castile married and ruled their realms together, retaining all of their distinct institutions and legislation.