their territory to include all of Catalonia. In 1137, Aragon and the County of Barcelona merged in dynastic union by the marriage of Ramon Berenguer IV and Petronilla of Aragon, their titles finally borne by only one person when their son Alfonso II of Aragon ascended to the throne in 1162. His territories were later to be known as the Crown of Aragon, which conquered many overseas possessions and ruled the westernMediterranean Sea with outlying territories in Naples and Sicily and as far as Athens in the 13th century. The forging of a dynastic link between the Crowns of Aragon and Castile marked the beginning of Barcelona's decline. The Bank of Barcelona, probably the oldest public bank in Europe, was established by the city magistrates in 1401. It originated from necessities of the state, as did the Bank of Venice (1402) and theBank of Genoa (1407).
The marriage of Ferdinand II of Aragon and Isabella I of Castile in 1469 united the two royal lines. Madrid became the centre of political power whilst the colonisation of the Americas reduced the financial importance (at least in relative terms) of Mediterranean trade. Barcelona had always been the stronghold of Catalan separatism and was the center of theCatalan Revolt (1640–52) against Philip IV of Spain. The great plague of 1650–1654 halved the city's population.
In the 18th century, a fortress was built at Montjuïc that overlooked the harbour. In 1794, this fortress was used by the French astronomer Pierre François André Méchain for observations relating to a survey stretching to Dunkirk that provided the official basis of the measurement of a metre. The definitive metre bar, manufactured from platinum, was presented to the French legislative assembly on 22 June 1799. The Napoleonic wars left the province ravaged, but the postwar period saw the start of industrialization.
The city was a Republican stronghold during the Spanish Civil War, and the fall of the city on 26 January 1939