The village is very old and already mentioned in Early Medieval documents; it was contended by Barga, Gallicano and Castiglione. After most of the communities in Garfagnana had willingly surrendered to the Ferrara branch of the Dukes of Este, Lupinaia, together with a few others, preferred to remain loyal to the Republic of Lucca when the neighbouring villages of Ceserana and Fosciandora, under the Este family, became outposts on Lucca's territory. This conferred to the small village of Lupinaia a new importance as fortified garrison in a strip of land between the territory of the Este to the north and that of the Medici who controlled Barga to the south.
It was fortified since the Middle Ages with simple defences filling the spaces between the houses; the present fortifications, however, were carried out by the Republic of Lucca at the beginning of the XVII
th century, during the war of 1613 caused by a quarrel over the frontiers, when clashes on the territory of Lupinaia prompted the construction of a
tower at the top of the village, from which the artillery could attack the nearby rocca of Ceserana controlled by the Este.
When the war finally ended in 1616 the government decided to surround the village with walls to increase the stability of its troubled frontiers and the security of the inhabitants of Lupinaia who had paid a high price in terms of blood during the war. The work cost 2000 scudi and upon its achievement was placed under the command of Captain Pieruccio with a small armed garrison. Only a few years later, in 1635, the same Captain Pieruccio complained about the poor conditions of the building and requested urgent repairs to the guardhouses and walls; these were promptly carried out. From then on, as tensions between the House of Este and the Republic of Lucca gradually eased, a period of decline began for the fort of Lupinaia, as for many others, resulting in the demobilisation of the garrisons and the sale of their buildings to private persons: a part of the walls was used for houses, another pulled down to make way for new roads or gardens; a few remain, together with the gate and several other bits of masonry, significant evidence of the village's past.