During the reign of city states on the Italian Peninsula, the separated Italian states faced numerous threats internally and externally. At the time of Machiavelli's birth, the Medici family was in charge of Florence. In 1494 under the rule of Piero de' Medici, King Charles VIII marched through the peninsula to Milan but first stopped at Florence. Not wanting to shed any blood, the Medici ruler fled to the French King and quickly surrendered the city, losing 200,000 florins and most notably the loss of Pisa, which had been under Florentine control since 1406. Piero was widely hated amongst the city and, just as quick to surrender, fled the city where the Republic of Florence took its place. It is under this republic that Machiavelli spends nearly his formal political career working for.
Under the papacy of the Borgia pope Pope Alexander VI, he assigned his illegitimate sone Cesare Borgia as a condotierro, a leader of mercenaries contracted by the pope. Backed by Italian mercenaries, 4000 Swiss pikemen, and 300 cavalry, Borgia captured Imola and Forlì as the commander of the papal army. Ruthless in practice, Machiavelli recognized his effectiveness despite the viciousness of the army while he served as a diplomat for the Republic of Florence. As much territory as he was able to control, all was reversed when his father died in 1503. Without the power of the pope behind him, his conquered territories soon became independent of the pope.
In the meanwhile, the disposed Medici family wanted to return to the crown in Florence. With the aid of Spanish Troops from Pope Julius II, the Medici defeated the Republic of Florence in Prato in 1512 despite the efforts of Machiavelli's citizen militia to resist. Under Giovanni de' Medici, a Medici was in power over Florence, upsetting those that had prospered under the Republic such as Machiavelli.
In the meanwhile, the disposed Medici family wanted to return to the crown in Florence. With the aid of Spanish Troops from Pope Julius II, the Medici defeated the Republic of Florence in Prato in 1512 despite the efforts of Machiavelli's citizen militia to resist. Under Giovanni de' Medici, a Medici was in power over Florence, upsetting those that had prospered under the Republic such as Machiavelli.