Giulio was made a Knight of Rhodes and Grand Prior of Capua, and, upon the election of his cousin Giovanni de' Medici to the pontificate as Pope Leo X (1513–21), he soon became a powerful figure in Rome. Upon his cousin's accession to the papacy, Giulio became his principal minister and confidant, especially in the maintenance of the Medici interest at Florence as archbishop of that city. On 23 September 1513, he was made cardinal and he was consecrated on 29 September. He had the credit of being the main director of papal policy during the whole of Leo X's pontificate.
He brought to the Papal throne a high reputation for political ability, and possessed in fact all the accomplishments of a wily diplomat. However, he was considered worldly and indifferent to what went on around him, including the ongoing Protestant reformation.
Francis I of France's conquest of Milan in 1524 prompted the Pope to quit the Imperial-Spanish side and to ally himself with other Italian princes, including the Republic of Venice, and France in the January of 1525. This treaty granted the definitive acquisition of Parma and Piacenza for the Papal States, the rule of Medici over Florence and the free passage of the French troops to Naples. This policy in itself was sound and patriotic, but Clement VII's zeal soon cooled; by his want of foresight and unseasonable economy he laid himself open to an attack from the turbulent Roman barons, which obliged him to invoke the mediation of the Emperor. One month later, however, Francis I was crushed and imprisoned in the Battle of Pavia, and Clement VII veered back to his former engagements with Charles V, signing an alliance with the viceroy of Naples.
But he was to change sides again when Francis I was freed after the Peace of Madrid (January 1526): the Pope entered in the League of Cognac together with France, Venice and Francesco Sforza of Milan. Clement VII issued an invective against Charles V, who in reply defined him a "wolf" instead of a "shepherd", menacing the summoning of a council about the Lutheran question.
Soon he found himself alone in Italy too, as the duke of Ferrara had sided with the Imperial army, permitting to the horde of Landsknechts led by Charles III, Duke of Bourbon, and Georg von Frundsberg, to reach Rome without harm. Charles of Bourbon died during the long siege, and his troops, unpaid and left without a guide, felt free to ravage Rome from May 6, 1527. The innumerable series of murders, rapes and vandalism that followed ended forever the splendours of the Renaissance Rome. Clement VII, who had displayed no more resolution in his military than in his political conduct, was shortly afterwards (June 6) obliged to surrender himself together with the castle of Sant'Angelo, where he had taken refuge. He agreed to pay a ransom of 400,000 ducati in exchange for his life; conditions included the cession of Parma, Piacenza, Civitavecchia and Modena to the Holy Roman Empire. (Only the last could be occupied in fact.) At the same time, Venice took advantage of his situation to capture Cervia and Ravenna while Sigismondo Malatesta returned in Rimini.
Clement was kept as a prisoner in Castel Sant'Angelo for six months. After having bought some Imperial officers, he escaped disguised as a peddler, and took shelter in Orvieto, and then in Viterbo. He came back to a depopulated and devastated Rome only in October 1528.
Meanwhile, in Florence, Republican enemies of the Medici took advantage of the chaos to again expel the Pope's family from the city.
In June of the following year the warring parts signed the Peace of Barcelona. The Papal States regained some cities and Charles V agreed to restore the Medici to power in Florence. In 1530, after an eleven-month siege, the Tuscan city capitulated, and Clement VII installed his illegitimate son Alessandro as Duke. Subsequently the Pope followed a policy of subservience to the Emperor, endeavouring on the one hand to induce him to act with severity against the Lutherans in Germany, and on the other to elude his demands for a general council.
During his half-year imprisonment in 1527, Clement VII grew a full beard as a sign of mourning for the sack of Rome. This was a violation of Catholic canon law, which required priests to be clean-shaven; however, it had the precedent of the beard which Pope Julius II had worn for nine months in 1511-1512 as a similar sign of mourning for the loss of the Papal city of Bologna.
Unlike Julius II, however, Clement VII kept his beard until his death in 1534. His example in wearing a beard was followed by his successor, Pope Paul III, and indeed by twenty-four popes who followed him, down to Pope Innocent XII, who died in 1700. Clement VII was thus the unintentional originator of a fashion that lasted well over a century.