Niccolò Machiavelli was born in Florence in 1469 of an old citizen family. In 1498 he was appointed secretary and a second chancellor to the Florentine Republic. During his time of office he accompanied Julius II on his first campaign of conquest. In 1507, as chancellor of the newly appointed Nove di Milizia, he organised an infantry force which fought at the capture of Pisa in 1509. Three years later it was defeated by the Holy League at Prato, the Medici returned to Florence, and Machiavelli was excluded from public life. He retired to his farm near San Casciano, where he gave his time to study and writing. After a brief return to public life, he died in 1527.