Catalonia, Spanish: Cataluña is an autonomous community of Spain and an officially recognized nationality. Catalonia comprises four provinces: Barcelona, Girona, Lleida, and Tarragona. The capital and largest city is Barcelona, the second largest city in Spain, and the center of one of the largest metropolitan areas in Europe. It comprises most of the territory of the former Principality of Catalonia, with the remainder now belonging to France. Catalonia borders France and Andorra to the north, the Mediterranean Sea to the east, and the Spanish regions of Aragon and the Valencian Community to west and south respectively. The official languages are Catalan, Spanish and Aranese (an Occitan dialect).
In the 10th century the eastern counties of the March of Gothia became independent from the Frankish kingdom, uniting as vassals of Barcelona. In 1137 Barcelona and Aragon formed the Crown of Aragon, and Catalonia became the base of Aragonese maritime power in the Mediterranean. Medieval Catalan literature flourished. Between 1469 and 1516, Aragon and Castille united to form the Kingdom of Spain, while retaining their distinct institutions. During the Reapers' War (1640–52), Catalonia rebelled against Spain, becoming a republic under French protection. Under the terms of the Treaty of the Pyrenees in 1659, which ended the wider Franco-Spanish war, France retained the northern parts of Catalonia, mostly incorporated in the county of Roussillon. During the War of the Spanish Succession (1701-14), the Crown of Aragon sided against Philip V of Spain, whose subsequent victory led to the abolition of Catalan institutions and a ban on the Catalan language.
Despite the repression and the Napoleonic and Carlist Wars, Catalonia experienced economic growth and industrialization. During the second half of the 19th century, the region saw a cultural renaissance coupled with incipient nationalism, while several workers movements appeared. In 1913, the four Catalan provinces formed a Commonwealth, and with the advent of democracy during the Second Spanish Republic (1931-39), the Generalitat of Catalonia was restored. After the Spanish Civil War, the Francoist dictatorship enacted repressive measures, abolishing Catalan institutions and banning the Catalan language again. During the 1950s and 1960s, Catalonia saw significant economic growth and became an important tourist destination, drawing many workers from across Spain and making Barcelona one of Europe's largest industrial metropolitan areas. Since the Spanish transition to democracy (1975–82) Catalonia has recovered political and cultural autonomy and is now one of the most economically dynamic regions of Spain.
Catalonia has its own police force, the Mossos d'Esquadra, whose origins date back to the 18th century. Since 1980 they have been under the command of the Generalitat, and since 1994 they have expanded in number in order to replace the national Guardia Civil and Policía Nacional, which report directly to the Homeland Department of Spain. The national bodies retain personnel within Catalonia to exercise functions of national scope such as overseeing ports, airports, coasts, international borders, custom offices, the identification of documents and arms control amongst others. Most of the justice system is administered by national judicial institutions. The criminal justice system is uniform throughout Spain, while "civil law" is administered separately within Catalonia. Navarre, the Basque Country and Catalonia are the Spanish regions with the highest degree of autonomy in terms of law enforcement.