The position of Sarzana at the entrance to the valley of the Magra (ancient Macra), the boundary between Etruria and Liguria in Roman times, gave it military importance in the Middle Ages. The first mention of the city is found in 983 in a diploma of Otto I; in 1202 the episcopal see was transferred from the ancient Luni, 5 kilometres (3 mi) southeast, to Sarzana.

Sarzana, owing to its position, changed masters more than once, belonging first to Pisa, then to Florence, then to the Banco di S. Giorgio of Genoa and from 1572 to Genoa itself.

The fortress of Sarzana.
These changes left in Sarzana a conspicuous fortress, which remains a focus of attraction for people interested in military history and specifically in the history of fortifications (see Star fortress).

In 1814 it was assigned to the Kingdom of Sardinia, the frontier between Liguria and Tuscany being now made to run between it and Carrara.

Sarzana was the birthplace of Pope Nicholas V in 1397.

A branch of the Cadolingi di Borgonuovo family, Lords of Fucecchio in Tuscany from the 10th century onwards, which had acquired the name of Buonaparte, had settled near Sarzana before 1264. In 1512 a member of the family (Francesco Buonaparte, who died in 1540) permanently took up residence in Ajaccio, becoming the founder of the Corsican line of Buonapartes and hence a direct forebear of Sebastiano Nicola Buonaparte. He in turn was the great-grandfather of the emperor Napoleon I (who was born in Corsica in 1769).

In 1921 Sarzana was the seat of fights between the population and Fascist squads (Italian: Fatti di Sarzana). During them, a small group of Carabinieri and, alter, simple citizens opposed and pushed back some 300 armed Fascists who had come to devastate the town, killing some of them. During the German occupation of Italy in World War II, Sarzana was a center of partisan resistance.