Indigenous resistance to the Spanish invasion continued during 1534, with Diego de Almagro founding Santiago de Quito (in present day Cola, near Riobamba) on August 15, 1534, later to be renamed San Francisco de Quito on August 28, 1534. The city was later moved to its present location and was refounded on 6 December 1534 by 204 settlers led by Sebastián de Benalcázar, who captured Rumiñahui and effectively ended any organized resistance. Rumiñahui was then executed on January 10, 1535. On March 14, 1541, Quito was declared a city and on February 14, 1556, was given the title Muy Noble y Muy Leal Ciudad de San Francisco de Quito ("Very Noble and Loyal City of San Francisco of Quito"). In 1563, Quito became the seat of a royal audiencia (administrative district) of Spain and became part of the Viceroyalty of Peru with its capital in Lima (see Real Audiencia de Quito).
As with other places colonized by the Christian Spanish invaders, the colonizers promptly established Roman Catholicism in Quito. The first church (El Belén) was in fact built even before the city had been officially founded. In January 1535, the San Francisco Convent was constructed, the first of about 20 churches and convents built during the colonial period. The Spanish forcibly converted the indigenous population to Christianity and used them as slave labor for construction. The Diocese of Quito was established in 1545 and was elevated to the Archdiocese of Quito in 1849.
In 1809, after nearly 300 years of Spanish colonization, Quito was a city of about 10,000 inhabitants. On August 10, 1809, a movement was started in Quito that aimed for political independence from Spain. On that date, a plan for government was established that placed Juan Pío Montúfar as president with various other prominent figures in other positions of government. However, this initial movement was ultimately defeated on August 2, 1810, when Imperial troops came from Lima, Peru, and killed the leaders of the uprising along with about 200 inhabitants of the city. A chain of conflicts concluded on May 24, 1822, when Antonio José de Sucre, under the command of Simón Bolívar, led troops into the Battle of Pichincha. Their victory marked the independence of Quito and the surrounding areas.