The Spanish were travellers and constantly in search for new lands to extend their territories. By the time they reached Quito, Rumiñahui had burnt the whole city, leaving only a devastated piece of land to the Spaniards, who built the whole region once again. In the month of August 1534 under the rule of Diego de Almagro the Spanish formally established the city of San Francisco de Quito and developed it both economically and culturally as one of the richest cities in South America. Sebastián de Benalcázar captured Rumiñahui who was later executed to death on January 10, 1535. Officially present name of the city was announced on March 14, 1541 as Muy Noble y Muy Leal Ciudad de San Francisco de Quito ("Very Noble and Loyal City of San Francisco of Quito"). It became the administrative district of Spain and part of the Viceroyalty of Peru. Christianity was introduced in the region with the construction of the first church El Belén. About 20 churches were built during the colonial period. The native Quito’s were oppressed and used as slaves in laborious work during Colonial rule. In 1545 the status of the city was promoted from Diocese of Quito to Archdiocese of Quito.
The oppression from Spanish rulers led to revolt from native Quito people. On August 10, 1809 a movement was started against the Spanish Empire in name of the city’s independence. The Quito’s residents formed their own government with Juan Pío Montúfar as President. But this movement was short-lived with the Spaniards arriving from Peru and killing all the government dignitaries along with the inhabitants. Even if this movement wasn’t successful, it led to a series of clashes with the Spanish, which concluded on May 24, 1822 when in the Battle of Pichincha, under the command of Simón Bolívar, Quito achieved its independence.
When Quito achieved independence, on June 24, 1822 the city got annexed to the Republic of Gran Colombia under the leadership of Simón Bolívar. When the Republic of Gran Colombia got dissolved in 1830, Republic of Ecuador was formed of which Quito became the capital.