The history of Málaga, shaped by the city’s location in the south of Spain on the western shore of the Mediterranean Sea, spans about 2,800 years, making Málaga one of the oldest cities in the world.
The first inhabitants to settle the site may have been the Bastetani, an ancient Iberian tribe. The Phoenicians founded the colony of Malaka here about 770 BC, and from the 6th century BC it was under the hegemony of ancient Carthage in north Africa. From 218 BC the city was ruled by the Roman Republic and then at the end of the 1st century during the reign of Domitian it was federated with the Roman Empire as Malaca (Latin). Thereafter it was governed under its own municipal code of law, the Lex Flavia Malacitana, which granted free-born persons the privileges of Roman citizenship.
The Romanization of Málaga was, as in most of southern Hispania Ulterior, effected peacefully through the foedus aequum; a treaty recognizing both parties as equals, obligated to assist each other in defensive wars or when otherwise summoned. During this period, under the rule of the Roman Republic, the Municipium Malacitanum became a transit point on the Via Herculea, revitalising the city both economically and culturally by connecting it with other developed enclaves in the interior of Hispania and with other ports of the Mediterranean Sea.
Málaga, by Edward Gennys Fanshawe, 1857
The decline of the Roman imperial power in the 5th century led to invasions of Hispania Baetica by Germanic peoples and by the Byzantine Empire.
In Visigothic Spain, the Byzantines took Malaca and other cities on the southeastern coast and founded the new province of Spania in 552. Malaca became one of the principal cities of the short-lived Byzantine Provincia Spaniae (Latin); it lasted until 624, when the Byzantines were expelled from the peninsula. After the Muslim Arab conquest of Hispania (711–718), the city, then known as Mālaqa (مالقة), was encircled by walls, next to which Genoese and Jewish merchants settled in their own quarters. In 1026 it became the capital of the Taifa of Málaga, an independent Muslim kingdom ruled by the Hammudid dynasty in the Caliphate of Córdoba, which existed for four distinct time-periods: from 1026 to 1057, from 1073 to 1090, from 1145 to 1153 and from 1229 to 1239 when it was finally conquered by the Nasrid Kingdom of Granada.
The siege of Mālaqa by the Catholic Monarchs in 1487 was one of the longest of the Reconquista. The Muslim population was punished for its resistance by enslavement or death. Under Castillian domination, churches and convents were built outside the walls to unite the Christians and encourage the formation of new neighbourhoods. In the 16th century, the city entered a period of slow decline, exacerbated by epidemics of disease, several successive poor food crops, floods, and earthquakes.
With the advent of the 18th century the city began to recover some of its former prosperity. For much of the 19th century, Málaga was one of the most rebellious cities of the country, contributing decisively to the triumph of Spanish liberalism. Although this was a time of general political, economic and social crisis in Málaga, the city was a pioneer of the Industrial Revolution on the Iberian peninsula, becoming the first industrialised city in Spain.
This began the ascendancy of powerful Málagan bourgeois families, some of them gaining influence in national politics. In the last third of the century, during the short regime of the First Spanish Republic, the social upheavals of the Cantonal Revolution of 1873 culminated in the proclamation of the Canton of Málaga on 22 July 1873. Málaga political life then was characterized by a radical and extremist tone. The federal republican (republicanismo federal) movement gained strong support among the working classes and encouraged insurrection, producing great alarm among the affluent.
A new decline of the city began in 1880. The economic crisis of 1893 forced the closing of the La Constancia iron foundry and was accompanied by the collapse of the sugar industry and the spread of the phylloxera blight, which devastated the vineyards surrounding Málaga. The early 20th century was a period of economic readjustment that produced a progressive industrial dismantling and fluctuating development of commerce. Economic depression, social unrest and political repression made it possible for petite bourgeois republicanism and the labour movement to consolidate their positions.
In 1933, during the Second Spanish Republic, Málaga elected the first deputy of the Communist Party of Spain, or Partido Comunista de España (PCE). In February 1937 the nationalist army, with the help of Italian volunteers, launched an offensive against the city under the orders of General Queipo de Llano, occupying it on 7 February. Local repression by the Francoist military dictatorship was perhaps the harshest of the civil war, with an estimated 17,000–20,000 citizens shot and buried in mass graves at the cemetery of San Rafael.
During the military dictatorship, the city experienced an expansion of tourism from abroad to the Costa del Sol, igniting an economic boom in the city beginning in the 1960s. After the end of the Francoist military dictatorship, the first candidate for mayor on the ticket of the Spanish Socialist Workers Party or Partido Socialista Obrero Español (PSOE) was elected, and remained in office until 1995, when the conservative Popular Party or Partido Popular (PP) won the municipal elections and have governed since.