Beginning from 1374, after Lucca had ousted the feudal regime, Camaiore was fortified. The commitment of its inhabitants to the construction of the walls exempted the commune from the payment of all other taxes except that on salt and the offering of a large candle for the celebration of S. Croce. Pietrasanta and Massalunense were also called by the government of Lucca to participate in the construction of the walls "prestando ciascun cittadino cinque opere manuali" (each citizen contributing with five days' labour).
Seven years later Camaiore was a well fortified castle
. Conquered by Pisa, at the beginning of the Fifteenth century Camaiore returned without bloodshed under the control of Paolo Guinigi, was taken by the Florentines in 1437, only to flourish again with its return under Lucca's domination.
During the XVIth
century the town expanded outside its walls; this expansion continued until 1617 when Viareggio became the main town in the vicariate and Camaiore lost most of its territory. When Napoleon's Empire collapsed, Camaiore followed the fate of the newly founded Republic of Lucca, created in 1801 by Napoleon under the rule of Prince Felice Baciocchi and his wife, the Emperor's sister Maria Elisa Bonaparte.