Shortly after he took over as leader of Florence in 1492, Charles VIII of France entered Italy in 1494 with a large army, in part on his way to Naples to assert his claim to the throne there, but also to support Lodovico Sforza, il Moro, ex-Regent of Milan, who wished to eject his nephew Gian Galeazzo and replace him as Duke, and had lured Charles to Italy to help him in this endeavour.
After settling matters in Milan, Charles moved towards Naples, and needed both to pass through Tuscany, as well as leave troops there to secure his lines of communication. Piero attempted to stay neutral, but this was unacceptable to Charles, who invaded Tuscany. Piero attempted a resistance, but did not receive much support from Florence, which was suffering from the influence of Savonarola; even his cousins deserted to Charles.
Piero therefore quickly gave up as Charles' army neared Florence, giving Charles everything he demanded, without making any attempt to negotiate better terms. The resultant fury in Florence lead to the Medici family fleeing, after which the family palazzo was looted, the substance as well as the form of the Republic of Florence was re-established, and the family were formally exiled, to wander through the states of Italy and Europe.
Some years later, in 1503, as the French and Spanish continued their struggle in Italy over the Kingdom of Naples, Piero was drowned attempting to flee the aftermath of a battle which the French (with whom he was allied) had lost.