From the age of 29, when he was placed in charge of the republic of Florence’s foreign affairs in subject territories, Machiavelli held a series of governmental posts. Among his tasks were to establish a militia, undertake diplomatic and military missions, oversee fortifications, and write an official history of the republic.