Massa is of pre-Roman (Liguri Apuani) origin and the first human settlements were established in the mountain area near the Frigido river, not far from the present city. Traces of this people have been found in Resceto and Pariana in the form of engravings, a vase containing ashes, a tomb and various tools. In addition, historians such as Ubaldo Formentini have suggested that there are ruins of Ligurian castles in Mirteto, Buita and Antona.
The existence of the town is first documented in 882 and it later came under the ownership of the Obertenghi who expanded and renovated earlier fortifications located on the Bagnara hill. Later still, the area was owned by the Lucchesi di Castruccio Castracani, who further strengthened the fortress. In 1441, the inhabitants of the area entrusted themselves to the Marquis of Fosdinovo, Antonio Alberico I Malaspina.
As a marquisate, from the fifteenth to the nineteenth century Massa was the capital of the independent principality, then duchy, of Massa and Carrara, which was ruled by the Malaspina and Cybo-Malaspina families. During this period the village of Bagnara changed radically: it was joined to Massa Vetere on the slopes of the castle with a large walled area, squares such as Piazza Aranci and Mercurio, streets such as Via Piatonata and Alberica, churches such as the old Cathedral of San Pietro were born. San Francesco and Madonna del Carmine, palaces such as Palazzo Ducale, Bourdillon and Cadets, fortifications as extensions to the castle and the various city gates. It was elevated by Ferdinand II, in 1620, to the rank of city.
During the Napoleonic domination, the city was annexed to the Principality of Lucca and Piombino, and Elisa Baciocchi initially chose it as a place of residence. Napoleon created public institutions, restored the navy and connected the city to Carrara with the road of the Foce. The Congress of Vienna (1815-16) returned Massa to Maria Beatrice d’Este, who repealed all the legislation enacted by Elisa Baciocchi during her tenure. In 1829 the city passed to the Dukes of Modena (Austria-Este family). In 1823 the Roman Catholic Diocese of Massa was founded by Pope Leo XII.
In 1859 Modena joined the Kingdom of Sardinia – an event not universally popular in Massa, to say the least. Initially the town was united with Emilia but following a referendum held in 1871 it was hived off and placed in the Tuscany region.
In 1938 Massa was merged with the municipalities of Carrara and Montignoso to form a new municipality with the name of Apuania. This was abolished in 1946 when the three pre-existing municipalities were reconstituted.
The city of Massa and its population suffered seriously during the Second World War as it was located at the Western edge of the Gothic Line. From September 1944 to April 1945 it was severely damaged by Anglo-American bombing. The city was later liberated by US troops, who occupied it on April 10, 1945.