Lucca and Pisa fought among themselves for centuries and the fortress passed from hand to hand until it finally became part of Florence, which united the entire Tuscan region under its rule. From the time when the tactics of warfare changed and gunpowder appeared, it became necessary to rebuild the defensive system. The rulers of Florence, the Medici family, modernized the fortress. Involving the great military architect Giuliano da Sangalo, possibly in collaboration with Leonardo da Vinci. In 1504, a plan for reconstruction and adaptation was developed, which was successfully implemented.