Castruccio was born in Lucca, a member of the noble family of Antelminelli, of the Ghibelline party. In 1300 he was exiled with his parents and others of their faction by the Guelphs "Black" party, then in the ascendant. At nineteen he became orphaned, and subsequently served as a condottiero under Philip IV of France in Flanders, then with the Visconti in Lombardy, and in 1313 under the Ghibelline chief, Uguccione della Faggiuola, lord of Pisa, in central Italy. He assisted Uguccione in many enterprises, including the capture of Lucca and the Battle of Montecatini, in which he was the main protagonist of the victory over the Guelph League led by the Florentines. However, due to his growing popularity, Uguccione had him jailed and condemned to death. An insurrection of the Lucchesi having led to the expulsion of Uguccione and his party, Castruccio regained his freedom and his position, and the Ghibelline triumph was presently assured. Elected lord of Lucca on 12 June 1316, he warred incessantly against the Florentines, though at home he renovated the Ponte della Maddalena, spanning the riverSerchio. At first he was the faithful adviser and staunch supporter of Frederick of Austria, who made him imperial vicar of Lucca, Lunigiana and Val di Nievole in 1320. After the Battle of Mühldorf he went over to the emperor Louis the Bavarian, whom he served for many years. In 1325 he defeated the Florentines at the battle of Altopascio, and was appointed by the emperor duke of Lucca, Pistoia, Volterra and Luni; two years later he captured Pisa, of which he was made imperial vicar. But, subsequently, his relations with Louis seem to have grown less friendly and he was afterwards excommunicated by the papal legate in the interests of the Guelphs. At his death in 1328 the fortunes of his young children were wrecked in the Guelph triumph. Niccolò Machiavelli wrote a Life of Castruccio Castracani. It is understood to be fictional in many places, and based upon classical aphorisms. It was made later in his life than some of Machiavelli's more well known works and is thought by some commentators such as Leo Strauss to be significant for the understanding of Machiavelli's political philosophy. Mary Shelley's novel Valperga; or, The Life and Adventures of Castruccio, Prince of Lucca, published in 1823, is based on the life of Castruccio Castracani, though the dates are slightly changed.