Although he was an immensely capable general and statesman, Cesare would have trouble maintaining his domain without continued Papal patronage. Niccolò Machiavelli cites Cesare's dependence on the good will of the Papacy, under the control of his father, to be the principal weakness of his rule. Machiavelli argued that, had Cesare been able to win the favor of the new Pope, he would have been a very successful ruler. The news of his father's death (1503) arrived when Cesare was planning the conquest of Tuscany. While he was convalescing in Castel Sant'Angelo, his troops controlled the conclave. The new pope, Pius III, supported Cesare Borgia and reconfirmed him as Gonfalonier; but after a brief pontificate of twenty-six days he died. Borgia's deadly enemy, Giuliano Della Rovere, then succeeded by dexterous diplomacy in tricking the weakened Cesare Borgia into supporting him by offering him money and continued papal backing for Borgia policies in the Romagna; promises which he disregarded upon election. He was elected as Pope Julius II to the papal dignity by the near-unanimous vote of the cardinals. Realizing his mistake by then, Cesare tried to correct the situation to his favor, but Pope Julius II made sure of its failure at every turn.
Cesare Borgia was betrayed while in Naples by Gonzalo Fernández de Córdoba, a man he had considered his ally, and exiled to Spain in 1504, while his lands were retaken by the Papacy. He was imprisoned first in the Castle of Chinchilla de Montearagón but after an attempted escape was moved to the Castle of La Mota, Medina del Campo. He did manage to escape from the Castle of La Mota with assistance and joined King John III of Navarre. He was killed in the early morning of March 13th, 1507 while fighting just outside of the city of Viana, Spain.