Trade has been active along the coast since Greek and Roman times. The history of medieval Catalonia is that of the counts of Barcelona, who emerged (9th cent.) as the chief lords in the Spanish March founded by Charlemagne. United (1137) with Aragón through marriage (see Raymond Berengar IV), Catalonia nevertheless preserved its own laws, cortes (or corts), and language (akin to Provençal). Catalan art and Catalan literature flourished in the Middle Ages. In the cities, notably Barcelona, the burgher and merchant classes grew very powerful.
Catalonian traders rivaled those of Genoa and Venice, and their maritime code was widely used in the 14th cent. They, and adventurers like Roger de Flor, were largely responsible for the expansion in the Mediterranean of the house of Aragón (see Aragón, house of). Catalonia failed in its rebellion (1461–72) against John II of Aragón, and after the union (1479) of Aragón and Castile, Catalonia declined. The centralizing policy of the Spanish kings, the shifting of trade routes with the consequent loss of commercial income, pirate attacks, and recurring plagues and famines were all major factors.
Agitation for autonomy was always strong. In the Thirty Years War (1618–48), Catalonia rose against Philip IV. The Catalan region of Roussillon, in the Pyrenees, passed to France in 1659 (see Pyrenees, Peace of the). In the War of the Spanish Succession, Catalonia sided with Archduke Charles against Philip V, who in reprisal deprived it of its privileges. In the late 19th and early 20th cent. it was a center of socialist and anarchist strength. In 1931 the Catalans established a separate government, first under Francesc Macià, then under Lluis Companys, which in 1932 won autonomy from the Spanish Cortes. A revolution (1934) for complete independence failed, but in 1936 autonomy was restored.
In the civil war of 1936–39, Loyalist Catalonia sided with the Republic and suffered heavily for its opposition to Franco. Barcelona was the Loyalist capital from Oct., 1937, to Jan., 1939. Catalonia fell to Franco in Feb., 1939. Under the Franco dictatorship, the use of Catalan was banned in public life. Catalonia elected its first parliament as an autonomous region in 1980, and by the mid-1990s Catalonian nationalists had become a force in both Catalonian and Spanish politics. Increased autonomy for Catalonia and recognition of the region as a "nation" within Spain was approved in 2006, but the Spanish government blocked a proposed Catalonian independence referendum in 2012. Catalonian parties have continued nonetheless to press the issue, and in 2013 called for a referendum to be held in Nov., 2014.