The Quito Revolution (1809–1812) () was a series of events that took place between 1809 and 1812 in the Real Audiencia de Quito, which led to the establishment of a short-lived State of Quito, and which can be considered as the seed of the independence movements that ended up forming the current Republic of Ecuador.
Background.
In 1809, the city of Quito was the capital of the Real Audiencia of Quito, with as president Manuel Ruiz Urriés de Castilla. The city had been the scene of several political revolts and uprisings against the Spanish during their colonial domination. In 1592, the people of Quito rose up in the so-called Alcabala Revolution, caused by high customs taxes. Another riot took place in 1765 for similar reasons. For its part, the indigenous population also staged several mutinies against the Crown over the centuries.
The Napoleonic invasion of Spain and the consequent abdication of Ferdinand VII in 1808, created chaos and confusion in Spain and its colonies. In the power vacuum, several Juntas were formed throughout Spain, popular local governments that claimed to defend their country and their King.
This conjuncture of events in Spain, the influence of the French Revolution, the independence of the United States and Haiti, and the ideas of the Enlightenment taught in Quito by Eugenio Espejo (1747-1795) through the School of Concordia, inspired Quito's Criollo upper class to also form a Junta (Sovereign Board).
First Autonomous Junta of Quito (10 August - October 1809).
On 10 August 1809 in the city of Quito, the Spanish ruler Manuel Ruiz Urriés de Castilla, I count of Ruiz de Castilla, was deposed by a group of rebels who formed a provisional Junta. This revolution was led by local intellectuals; doctors, marquises and Criollos residing in the city of Quito, without the involvement of any peninsular Spaniard. Members of the Patriot group were Juan Pío Montúfar, Juan de Salinas y Zenitagoya, Juan José Guerrero y Matheu, Juan de Dios Morales, Manuela Cañizares, José de Cuero y Caicedo, amongst others.
This event is known in Ecuador and other countries in the region as the "First Cry of Hispanic American Independence", because it constituted the beginning of the emancipation process of Latin America. 10 August is also Ecuador's National day.
Juan Pío Montúfar, Marquis of Selva Alegre, was installed as President of the Junta, who still recognized King Ferdinand VII as the only legitimate authority, but not the local Spanish colonial authorities.
The Junta organized an army of 2,000 men to defend the city of Quito. They requested help from the territories of Cuenca, Guayaquil and Popayán, but these refused when they learned that the viceroy of Peru, José Fernando de Abascal, had embarked on a campaign against Quito. ;br ;
The Quiteños ended up surrounded by Royalist troops, both to the north and the south, and experienced serious difficulties in feeding themselves. They were easily defeated by an army of 5,000 Royalists from Lima and New Granada who advanced with the support of Pasto, Guayaquil and Cuenca.
Many plotters and members of the Junta were arrested on 24 October 1809, and imprisoned. ;br ;
Juan Pío Montúfar demonstrated his willingness to work for the restoration of the legitimate Government and by doing so, escaped imprisonment.
Mutiny of 2 August 1810.
On 2 August 1810, a group of Patriots attacked the Royal Barracks of Lima (in Quito) with the intention of freeing the 32 heroes who had participated the previous year in the First Autonomous Government Board (Junta) of Quito. They had been accused of crimes of lese majeste, for which the prosecutor requested the death penalty.
The Patriots attacked two barracks and a prison, but before the prisoners could be liberated, they were butchered by their guards. The fighting then spread to the city streets. Between 200 and 300 people were killed by Spanish soldiers, and looting produced losses valued between 200 and 500 thousand pesos at the time. ;br ; 
The massacre, ordered by the Royalist governor, Manuel Ruiz Urriés de Castilla had wide repercussions throughout Hispanic America, as was seen an act of barbarism and justification of the "War to the Death", later decreed by the liberator Simón Bolívar.
Second Junta of Quito (September 1810 - October 1811).
On 9 September 1810, after a four-month journey from Spain, Colonel Carlos de Montúfar, who had been sent by the Supreme Central Junta in Seville as Royal Commissioner, entered Quito and was received with honors by Ruiz Urriés de Castilla. But he was looked upon with suspicion by the rest of the Spanish authorities, who were dissatisfied with the fact that Carlos de Montúfar was the son of Juan Pío Montúfar, who had presided over the First Government Junta in 1809 and was seen as an Independentist.
Indeed, as soon as he arrived, the young Montúfar decided to convene a new Government Junta, and that would be formed as a triumvirate composed by Ruiz Urriés de Castilla, José de Cuero y Caicedo, Bishop of Quito and former vice-president of the First Junta, and Carlos Montúfar himself. Representatives were immediately elected taking into account the three classes, as in France: the clergy, the nobility and the common people, the latter chosen by the method of electors. Ruiz Urriés de Castilla was appointed president of the board.
On 22 September, the elected representatives appointed Juan Pío Montúfar, II Marquis of Selva Alegre and father of the Royal Commissioner, as vice president of the Junta. This was not seen well by the Spanish authorities and by some nobles, who disliked how the Montúfar family achieved increasing power. ;br ;
The authorities of Guayaquil and Cuenca refused to recognize the Junta.
State of Quito (October 1811 - December 1812).
On 9 October 1811, the Second Government Junta declared that it wouldn't obey the viceroy of New Granada any more, and adhere to the values of 10 August 1809. Just two days later, Quito proclaimed its total independence from Spain. Ruiz Urriés de Castilla was forced to resign from the presidency of the Junta, being replaced by Bishop José de Cuero y Caicedo.
On 15 February 1812, the first Ecuadorian Constitution was promulgated - the "Constitution of the State of Quito" - which established a Republic with division of powers. This was the first independent and sovereign State proclaimed on the territory of current Ecuador and exercised jurisdiction over the central and northern Sierra, as well as the Esmeraldas coastline.
To defend the sovereignty of the new Republic, the people of Quito organized militias on different fronts, fighting a serie of battles against the Spanish troops even with the few resources they had on hand. Colonel Carlos de Montúfar prepared to face General Toribio Montes, who had been sent from Lima to destroy the State of Quito and become the new President of the restored Real Audiencia of Quito. 
After several defeats, the remains of the Patriot Army were finally destroyed in the Battle of Ibarra on 1 December 1812.
The colonial Government was reestablished in the capital city and violently pacified by the Spanish under the rule of Toribio Montes and Melchior Aymerich for the next 10 years.
Only after the Battle of Pichincha in May 1822, would Quito and the rest of Ecuador regain its independence.
References.
 ;templatestyles src="Reflist/styles.css" / ;