 The first war with Charles's great nemesis Francis I of France began in 1521.Charles allied with England and Pope Leo X against the French and the Venetians, and was highly successful, driving the French out of Milan and defeating and capturing Francis at the Battle of Pavia in 1525.To gain his freedom, Francis ceded Burgundy to Charles in the Treaty of Madrid, as well as renouncing his support of Henry II's claim over Navarre.