Barcelona is the most populous city of the Autonomous Community of Catalonia and the second largest city in Spain, with a population of 1,615,908 in 2008, while the population of the Metropolitan Area was 3,161,081. It is the central nucleus of the Urban Region of Barcelona, which relies on a population of about 5.5 million. It is located on the Mediterranean coast () between the mouths of the rivers Llobregat and Besòs and is bounded to the west by the Serra de Collserola ridge (512 m/1,680 ft).
Barcelona is a major economic centre with one of Europe's principal Mediterranean ports, and Barcelona International Airport is the second largest in Spain after Madrid-Barajas Airport. Founded as a Roman city, Barcelona became the capital of the Counts of Barcelona. After merging with the Kingdom of Aragon, it became one of the most important cities of the Crown of Aragon. Besieged several times during its history, Barcelona is today an important cultural centre and a major tourist destination and has a rich cultural heritage. Particularly renowned are architectural works of Antoni Gaudí and Lluís Domènech i Montaner that have been designated UNESCO World Heritage Sites. The city is well known in recent times for the 1992 Summer Olympics. The headquarters of the Union for the Mediterranean are located in Barcelona.
As the capital of Catalonia, Barcelona houses the seat of the Catalan government, known as the Generalitat de Catalunya; of particular note are the executive branch, the parliament, and the Supreme Court of Catalonia. The city is also the capital of the shire (comarca) of the Barcelonès.
Barcelona is located on the northeast coast of the Iberian Peninsula, facing the Mediterranean Sea, on a plateau approximately 5 km (3 mi) wide limited by the mountain range of Collserola, the Llobregat river to the south-west and the Besòs river to the north. This plateau has 170 km2 (66 sq mi), of which 101 km² are occupied by the city itself. It is 160 km (100 mi) south of the Pyrenees and the Catalonian border with France.
Collserola, part of the coastal mountain range, shelters the city to the north-west. Its highest point, the peak of Tibidabo, 512 m (1,680 ft) high, offers striking views over the city and is topped by the 288.4 m (946.2 ft) Torre de Collserola, a telecommunications tower that is visible from most of the city. Barcelona is peppered with small hills, most of them urbanized and that gave their name to the neighbourhoods built upon them, such as Carmel (267 m), Putxet (181 m) and Rovira (261 m). The escarpment of Montjuïc (173 m), situated to the southeast, overlooks the harbour and is topped by Montjuïc castle, a fortress built in the 17–18th centuries to control the city as a replacement for the Ciutadella. Today, the fortress is a museum and Montjuïc is home to several sporting and cultural venues, as well as Barcelona's biggest park and gardens.
The city borders are the municipalities of Santa Coloma de Gramenet and Sant Adrià de Besòs to the north; L'Hospitalet de Llobregat and Esplugues de Llobregat to the south; the Mediterranean Sea to the east; and Montcada i Reixac and Sant Cugat del Vallès to the west.