Florence was founded as a colony of the Etruscan city of Fiesole in about 200 BC, later becoming the Roman Florentia, a garrison town controlling the Via Flaminia. In the early 12th century the city became a free comune (township) and by 1138 it was ruled by 12 consuls, assisted by the Council of One Hundred, a bunch of rich merchants. In 1207, due to intractable problems with faction fighting, the council was replaced by a foreign (and thus allegedly unbiased) governor, the podestà.
In the 13th century the pro-papal Guelphs and pro-imperial Ghibellines started a century-long bout of bickering, which resulted in the Guelphs forming their own government in the 1250s. By 1292 Florentine nobles were excluded from government. The city became increasingly democratised, eventually becoming a commercial republic controlled by the Guelph-heavy merchant class.
The great plague of 1348 had halved the city's population. In the latter part of the 14th century the Medicis began consolidating power, eventually becoming bankers to the papacy. Cosimo Medici - patron of artists such as Donatello, Brunelleschi, Fra Angelico and Filippo Lippi - became ruler of Florence. Perhaps the most famous Medici was Lorenzo, grandson of Cosimo, who took power in 1469. His court fostered a great development of art, music and poetry, and Lorenzo sponsored philosophers and artists such as Botticelli, da Vinci and Michelangelo.
In 1494 the Medicis went broke and lost their hold on power. The city fell under the control of Girolamo Savonarola, a Dominican monk who led a puritanical republic until he fell from public favour and was hanged and burned as a heretic in 1498. The Medicis returned to Florence in the 16th century, having united themselves by marriage with Emperor Charles V, and ruled for the next 200 years. In 1737 the Grand Duchy of Tuscany passed to the House of Lorraine, which was incorporated into the Kingdom of Italy in 1860. Florence became capital of the Kingdom and remained so until Rome took over in 1875.