After founding nearby Cuma in the 8th century BC, the ancient Greeks settled the city in around 680 BC, calling it Parthenope. Under the Romans, the area became an ancient Miami of sorts: a sun-soaked spa region that drew the likes of Virgil. Dampening the bonhomie was Mt Vesuvius' eruption in AD 79.
Naples fell into Norman hands in 1139 before the French Angevins took control a century later, boosting the city's cred with the mighty Castel Nuovo. By the 16th century, Naples was under Spanish rule and riding high on Spain's colonial riches. By 1600, it was Europe's largest city and a burgeoning baroque beauty adorned by artists like Luca Giordano, Jusepe de Ribera and Caravaggio.
Despite a devastating plague in 1656, Naples' ego soared under the Bourbons (1734–1860), with epic constructions such as the Teatro San Carlo and the Reggia di Caserta sealing the city's showcase reputation.
An ill-fated attempt at republican rule in 1799 was followed by a short stint under the French and a final period of Bourbon governance before nationalist rebel Giuseppe Garibaldi inspired the city to snip off the puppet strings and join a united Italy in 1860.
Although the Nazis took Naples in 1943, they were quickly forced out by a series of popular uprisings between 26 and 30 September, famously known as the Quattro giornate di Napoli (Four Days of Naples). Led by locals, especially by young scugnizzi (Neapolitan for 'street urchins') and ex-soldiers, the street battles paved the way for the Allies to enter the city on 1 October.
Despite setting up a provisional government in Naples, the Allies were confronted with an anarchic mass of troops, German prisoners of war and bands of Italian fascists all competing with the city's starving population for food. Overwhelmed, Allied authorities turned to the underworld for assistance. As long as the Allies agreed to turn a blind eye to their black-market activities, the Mafia was willing to help. And so the Camorra (Neapolitan Mafia) was given a boost.
On 23 November 1980, a devastating earthquake struck the mountainous area of Irpinia, 100km east of Naples. The quake, which left more than 2700 people dead and thousands more homeless, caused extensive damage in Naples. It is believed that US$6.4 billion of the funds poured into the region to assist the victims and rebuilding ended up in the pockets of the Camorra.
In 2011, Neapolitan voters elected the city's current mayor, Luigi de Magistris, a youthful former public prosecutor and vocal critic of both the Mafia and government corruption. Determined to improve the city's liveability, de Magistris has pushed through a number of initiatives, including the transformation of the Lungomare from a traffic-clogged thoroughfare into a pedestrian and bike-friendly waterfront strip.
Other eco-friendly initiatives have included the purchase of greener buses and extra trains for the city’s metro system. While De Magistris is not without his critics, his progressive, anticorruption agenda has hit the right note with many Neapolitans. In 2016, the Gen-X independent was re-elected city mayor, beating rival Gianni Lettieri of the centre-right Forza Italia party with 66.8% of the total vote.