 Florence had been under a republican government since 1494, when the leading Medici family and its supporters had been driven from power. During this time, Machiavelli thrived under the patronage of the Florentine gonfaloniere (or chief administrator for life) Piero Soderini. In 1512, however, with the assistance of papal troops, the Medici defeated the republic's armed forces and dissolved the government. Machiavelli was a direct victim of the regime change: he was initially placed in a form of internal exile and, when he was (wrongly) suspected of conspiring against the Medici in 1513, he was imprisoned and tortured for several weeks. His retirement thereafter to his farm outside of Florence afforded the occasion and the impetus for him to turn to literary pursuits.