Giuliano della Rovere (circa 1445-1513), the son of a poor family, was appointed cardinal over the church of San Pietro by his uncle, Pope Sixtus IV, in 1471. He became papal legate for his uncle, a position that took him on diplomatic missions to France and to the papal states. He was a bitter rival of Alexander VI, and by 1494, two years into the Borgia pope's reign, Giuliano left Rome, fearing for his life. He went to France, where he encouraged Charles VIII to press ahead with his plans for an Italian invasion, hoping to thereby depose Alexander. He accompanied Charles on his invasion and on his subsequent retreat. While in France, he judiciously welcomed Cesare Borgia's visit and even encouraged his conquest of the Romagna. He did not return to Rome until Alexander's death in 1503. He lacked the votes to get himself elected, but Alexander's pious and ascetic successor, Pius III, was in poor health and died after less than a month in office. Giuliano made a deal with Cesare Borgia, then desperate for allies, to get the votes of the Spanish cardinals, and became Pope Julius II on October 1, 1503.
Julius spent the majority of his papacy occupied by war, often appearing on the battlefield himself, wearing armor under his papal robes. Julius quickly disposed of Cesare, regardless of their arrangement, and set about putting the Romagna back under the control of the Papal States. The Venetians refused to give up several cities they had seized after Cesare's fall, so Julius formed the League of Cambrai, an alliance with Louis XII, Ferdinand of Spain, and Emperor Maximilian I, to defeat them. The Venetians surrendered, and Julius, chafing under the domination of Louis, formed an alliance with Venice and Switzerland to drive out the French. This alliance eventually included Ferdinand, Maximilian, and even Henry VII of England in what was called the "Holy League." The League's forces were defeated by the French at Ravenna in April 1512, but the demoralized French army subsequently withdrew, and the League proved victorious. Julius restored the Sforza to power in Milan and the Medici in Florence. He was turning his efforts against Spanish domination when he died unexpectedly in 1513. Machiavelli observes that the impetuous and energetic pope's unlikely successes probably could not have continued had he lived longer. Exhausted by Julius' military exploits and Alexander's debauchery, most Italians were pleased to see the milder Giovanni de Medici elected as Pope Leo X.
An indefatigable warrior and defender of the church's authority, Julius also adorned his church with grand works of art. He commissioned Michelangelo to paint the ceiling of the Sistine Chapel. A never-completed commission for Julius' monumental tomb produced some of Michelangelo's best sculpture. He hired Raphael, then in his 20s, to paint his new papal chambers, replacing pictures of the despised Borgias. Julius also began construction of what would become the present day church of St. Peter's in Rome.