Trapani was founded by the Elymians to serve as the port of the nearby city of Erice (ancient Eryx), which overlooks it from Monte San Giuliano. The city sits on a low-lying promontory jutting out into the Mediterranean Sea.
It was originally named Drepana or Drépanon from the Greek word for "sickle", because of the curving shape of its harbour. Carthage seized control of the city in 260 BC, subsequently making it an important naval base, but ceded it to Rome in 241 BC following the Battle of the Aegates in the First Punic War.
Two ancient legends tell of mythical origins for the city. In the first legend, Trapani stemmed from the sickle which fell from the hands of the goddess Demeter while she was seeking for her daughter Persephone, who had been kidnapped by Hades. The second myth features Kronos, who eviscerated his father Ouranos, god of the sky, with a sickle which, falling into the sea, created the city. In ancient times, Saturn was the god-protector of Trapani. Today, Saturn's statue stands in a piazza in the centre of the city.
After the Roman, Vandal, Ostrogoth, Byzantine and (from 827) Arab dominations, Trapani was conquered by the Normans of Roger I in 1077, flourishing under their dominations and having also a role in the Crusades as one of the most important ports in the Mediterranean Sea. In the 17th century, the city decayed due to revolts, plagues, and famines, but in the following century, it grew from 16,000 to 30,000 inhabitants; commerce remained of local importance, while its military position in the Kingdom of Naples remained notable.
The city was badly damaged during World War II, when it was subjected to intense Allied bombardments. It has grown greatly since the end of the war, sprawling out virtually to the foot of Monte San Giuliano. Tourism has grown in recent years due to the city's proximity to popular destinations such as Erice, Segesta, and the Egadi Islands.
The comune of Trapani consists of two discontiguous parts separated by the comune of Paceco. The northern part includes much of the city and some rural area; the much larger southern part includes the area of Marausa, half of Trapani-Birgi Airport and a large rural area. The comune does not include the north-eastern suburbs of the urban area, such as Casa Santa, which are part of the comune of Erice. The comune of Trapani has a population of 70,000, less than the 80,000 of Marsala, the most populous comune in the province. The entire urban area of Trapani, including those parts in the comune of Erice, has over 90,000 residents.
Much of Trapani's economy still depends on the sea. Fishing and canning are the main local industries, with fishermen using the mattanza technique to catch tuna. Coral is also an important export, along with salt, marble, and marsala wine. The nearby coast is lined with numerous salt-pans.
The city is also an important ferry port, with links to the Egadi Islands, Pantelleria, Sardinia, and Tunisia. It also has its own airport, the Trapani-Birgi Airport.
Much of the old city of Trapani dates from the later medieval or early modern periods; there are no extant remains of the ancient city. Many of the city's historic buildings are designed in the Baroque style. Notable monuments include:
Monte Erice is a cable car ride from the city and aside from the cobbled streets and medieval castle, there are views of Tunisia and Africa from up there on clear days.
Several beaches run along the coast of Trapani, the best of which are at Marausa about 9 km (6 mi) south of the city.
The city is renowned for its Easter related Holy Week activities and traditions, culminating between Good Friday and Holy Saturday in the Processione dei Misteri di Trapani, colloquially simply the Misteri di Trapani (in English the Procession of the Mysteries of Trapani or the Mysteries of Trapani), a day-long passion procession organized and sponsored by the city's guilds, featuring twenty floats of wood, canvas and glue sculptures, mostly from the 17th and 18th centuries, of individual scenes of the events of the Passion.
The Misteri are among the oldest continuously running religious events in Europe, having been played every Good Friday since before the Easter of 1612. Running for at least 16 continuous hours, but occasionally well beyond the 24 hours, they are the longest religious festival in Sicily and in Italy. Important also to the cult of the Madonna of Trapani.
The city gives its name to a variety of pesto – pesto alla trapenese – made using almonds instead of the traditional pine nuts in Ligurian pesto.
Trapani was also used, even if never mentioned by name, but only evidenced in movie scenes, as the base for filming the first serie of La piovra drama miniseries.
Trapani-Birgi Airport is a military-civil joint use airport (third for traffic on the island). Recently the airport has seen an increase of traffic thanks to low-cost carriers from all parts of Europe (i.e. London-Stansted and London-Luton, Paris Beauvais, Dublin, Bruxelles, Munich, Frankfurt, Eindhoven, Stockholm, Malta).
From 28 September to 9 October 2005 Trapani was the location of Acts 8 and 9 of the Louis Vuitton Cup. This sailing race featured, among other entrants, all the boats that took part in the 2007 America's Cup.
The town is also the base for the local football team Trapani Calcio. It made debut in Serie B in 2013–14 season.