Spanish conquistador Hernán Cortés arrived in 1521 and began a brutal campaign of colonial conquest. The city fell to Spanish rule, and much of it was destroyed alongside rich indigenous heritage. Cortés rebuilt the city, renaming it and making it the capital of New Spain. Under Spanish rule, Mexico City became one of the wealthiest and most important cities in the Americas and was a center of trade, culture, and political power. Many of its iconic buildings were constructed during this time, including the Cathedral of Mexico City and the National Palace. During the Mexican War of Independence, the city was captured in 1810 by rebel forces under Miguel Hidalgo but soon recaptured by the Spanish. After years of fighting, Mexico finally gained independence from Spain in 1821, and Mexico City became the capital of the new republic. In the decades that followed the city underwent rapid growth and modernization, with new neighborhoods, parks, and public buildings constructed.