Barcelona was founded by the Carthaginians, and, according to tradition, it supposedly derives its name from the great Barca family of Carthage. The city flourished under the Romans and Visigoths, fell to the Moors (8th cent.), and was taken (801) by Charlemagne, who included it in the Spanish March. In the 9th to 10th cent. the march became independent under the leadership of the powerful counts of Barcelona, who wrested lands to the south from the Moors, thus acquiring all Catalonia. The counts also won suzerainty over several fiefs in S France.
The marriage of Count Raymond Berengar IV to the heiress of Aragón united (1137) the two lands under one dynasty; the title, count of Barcelona, was subsequently borne by the kings of Aragón, who made the city their capital, and later the kings of Spain. Under its strong municipal government Barcelona vastly expanded both its Mediterranean trade, becoming a rival of Genoa and Venice, and its cloth industry and flourished as a banking center. Reaching its peak around 1400, the city later shared in the general decline of Catalonia. It was repeatedly (1640–52, 1715, 1808–14) occupied by the French.
Barcelona was always the stronghold of Catalan separatism and was the scene of many insurrections. It was the center of the Catalan revolt (1640–52) against Philip IV of Spain. Later it also became the Spanish center of anarchism, syndicalism, and other radical political beliefs. It was the capital of the Catalan autonomous government (1932–39) and the seat of the Spanish Loyalist government from Oct., 1937, until its fall to Franco on Jan. 26, 1939. Barcelona remains a center of separatism and political liberalism; in the 1950s, it was the scene of sporadic demonstrations against the Franco regime. Present-day Barcelona is a cultural center of Spain, and since the 1970s it has reasserted its Catalan linguistic character. It was the site of the 1992 Summer Olympics.