During the first three-quarters of the sixteenth century, matters of balance of power and dynastic succession weighed heavily on the course of European diplomacy and war. Europe's largest and most powerful kingdoms, France and Spain, were the continent's staunchest rivals. Tensions increased after 1516, when the kingdoms of Castile, León, and Aragon were formally unified under Charles I of Spain, who three years later expanded his domains after his election as Holy Roman Emperor and began to surround France. In 1521, France went to war with the Holy Roman Empire. Spanish troops routed French armies in France, the Italian Peninsula, and elsewhere, forcing the French Crown to surrender in 1526 and again in 1529. The Italian Wars, as the French-Spanish wars came to be known, reignited in 1536 and again in 1542. Intermittent warring between the Valois monarchy and the Habsburg Empire continued until 1559.