
In 1516 Charles of Ghent (emperor and king of Spain), grandson of Isabella (queen of Castile) and Ferdinand (king of Aragon) and of Emperor Maximilian (grandfather of Charles V), inherited Castile and Aragon with their lands in Italy and America, and in 1519 he was elected Holy Roman Emperor as Charles V. Castilian towns rose against his foreign advisers in the Comuneros revolt, crushed in 1521. In the same years Hernán Cortés (conqueror of the Aztec Empire) conquered the Aztec Empire, and from 1532 Francisco Pizarro (conqueror of the Inca Empire) conquered the Inca Empire, helped by Indigenous allies and by epidemics that killed millions.

Charles V (emperor and king of Spain) fought France, the Ottomans and the Protestant princes of Germany, and in 1556 he handed Spain, Italy, the Netherlands and America to his son Philip II (king of Spain at its height). Philip made Madrid his capital in 1561 and built the monastery-palace of El Escorial. In 1571 a Christian fleet he largely paid for defeated the Ottomans at Lepanto, and in 1580 he became king of Portugal as well.
His empire was almost always at war. The Dutch provinces revolted from 1568, and the northern ones won their independence in the end. In 1588 Philip II (king of Spain at its height) sent the Armada against England; it was beaten off and wrecked by storms. American silver, landed at Seville, paid for the wars, but the crown still went bankrupt several times.

The 17th century brought economic decline, plague and the expulsion of about 300,000 Moriscos, descendants of Muslims, between 1609 and 1614. Portugal broke away in 1640, and the Thirty Years’ War cost Spain its leading place in Europe. Yet this was the Golden Age: Miguel de Cervantes (author of Don Quixote) published Don Quixote in 1605 and 1615, Lope de Vega (playwright of the Golden Age) wrote hundreds of plays, and Diego Velázquez (court painter of Philip IV) painted Las Meninas in 1656. When Charles II (last Habsburg king of Spain) died childless in 1700, the line of the Spanish Habsburgs ended.
