Quito's origins date back to the first millennium, when the Quitu tribe occupied the area and eventually formed a commercial center. According to Juan de Velasco's 1767 bookHistoria del Reino de Quito, the Quitu were conquered by the Caras tribe, who founded the Kingdom of Quito about 980 AD. For more than four centuries, Quito was ruled under the kings (shyris).
Caras and their allies were narrowly defeated in the epic battles of Tiocajas and Tixán in 1462, by an army of 250,000 led by Túpac Inca, the son of the Emperor of the Incas. After several decades of consolidation, the Kingdom of Quito became integrated into the Incan Empire. In 1534, the Caras/Quitu people were conquered by the Spanish.
Indigenous resistance to the Spanish invasion continued during 1534, with Diego de Almagro founding Santiago de Quito (in present day Colta, 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ñahuiand 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