The first mention of Viareggio dates back to 1169 when a wooden tower guarding the coast was built. A little over two years later, in (1172) a military building named "Turris de Via Regia" was erected, taking its name from the road that linked it to Lucca (known today as via Montramito). In the following years the area around Viareggio, was involved in the hostilities between Pisa and Lucca, in their attempt to gain control over the coastal area. The conflict was spurred by the desire of the Lucchesi to finally gain access to the sea, and to the Pisane fear of the economic competition of its rival city. It is during these years that the feudal Lords of Versilia were forced to abdicate in favour of Castruccio Castracani. In the following years the area upon which Viareggio would eventually be built was marked by a number of minor battles, invasions and pillages. In addition, the area was also affected by the pestilence which, recounted by Giovanni Boccaccio in his masterpiece the "Decameron", spread throughout the whole of Italy.