Mexican War of Independence

The Mexican War of Independence (1810–1821) was a war between the people of Mexico and the Spanish colonial government. It started on 16 September 1810 since Mexican-born Spaniards ("criollo people"), Mestizos and Amerindians wanted their independence from Spain.
The idea of Mexican independence went back to the years after the Spanish conquest of the Aztec Empire. Martín Cortés led a revolt against the Spanish government.
After the failed in 1799, the War of Independence really started with the Grito de Dolores in 1810. Spain was busy fighting for its independence against the invading First French Empire during the Peninsular War and most of Latin America revolted.
Beginning.
Miguel Hidalgo y Costilla, was a Mexican priest and a member of a group of educated "Criollos" in Querétaro. They met in "tertulias" (salons) and decided in 1810 that a revolt against the colonial government was needed because Napoleon I had replaced the King of Spain with a French foreigner. Hidalgo worked closely with Ignacio de Allende, a nobleman with military training, for a battle in December 1810.
They were betrayed by a member of the group. Hidalgo turned to his parishioners in the town of Dolores. Around 6:00 a.m. on September 16, 1810, he declared independence from the Spanish crown and war against the government in what was known as the "Grito de Dolores". The revolutionary army decided to fight for independence and marched on to Guanajuato, which was a major colonial mining center that was governed by Spaniards and criollos.
There, the leaders of the "Citizens' Army," which was poorly organized, locked themselves in the granary and killed most of the Spaniards and Criollos who were there. That included high-ranking nobles and supporters of the fight for independence, which caused Hidalgo and Allende to fight with each other.
Allende no longer wanted to fight alongside Hidalgo and left with his soldiers.
On October 30, Hidalgo's army fought the Spanish resistance at the Battle of Monte de las Cruces and won.
In January 1811, Spanish forces fought the Battle of the Bridge of Calderón and won. That made the rebels flee towards the United States-Mexican border, where they hoped to escape, but they were caught by the Spanish Army.
Hidalgo and what was left of his army were caught in the state of Coahuila at the Wells of Baján. He had a trial done by the Spanish Inquisition on 30 July 1811 and was executed.
After Hidalgo's death of Father Hidalgo, the leadership of the revolutionary army was taken over by José María Morelos. Under his leadership, the cities of Oaxaca and Acapulco were taken. In 1813, the Congress of Chilpancingo had its first meeting. On 6 November, the Congress signed the first official document of independence, known as the Solemn Act of the Declaration of Independence of Northern America.
A long war followed at the Siege of Cuautla. In 1815, Morelos was caught by Spanish colonial authorities. He was put on trial and executed for treason in San Cristóbal Ecatepec on 22 December.
Independence.
By the early 1820s, the independence movement was close to collapsing. Two of its main leaders had been executed, and the rebels could not easily fight the well-organized Spanish military. Also, many of the most influential criollos did not care any more. The violence of the unorganized army of Hidalgo and Morelos was not liked. The Mexicans wanted a better and less bloody way to get their independence.
In December 1820, Viceroy Juan Ruiz de Apodaca sent a force led by a royalist criollo officer, Colonel Agustín de Iturbide, to fight in Oaxaca. Iturbide was famous for the way in which he went after the rebels during the early independence struggle.
The fight at Oaxaca came at the same time as successful military coup in Spain against the monarchy of Ferdinand VII. Ferdinand was forced to reinstate the liberal Spanish Constitution of 1812. When that news reached Mexico, Iturbide saw it as an opportunity for the criollos to gain control of Mexico. After clashing with Guerrero's forces, Iturbide switched sides. He invited the rebel leader to meet to discuss a new independence struggle.
In the town of Iguala, Iturbide created three rules, or "guarantees," for Mexican independence from Spain:
He made his troops accept these rules, which are known as the Plan of Iguala. Iturbide then persuaded Guerrero to join his forces in support of the new independence. A new army, the Army of the Three Guarantees, was placed under Iturbide's command to enforce the plan. It was so broad that it pleased both patriots and loyalists. The goal of independence and the protection of Roman Catholicism brought together all factions.
Iturbide's army was joined by rebel forces from all over Mexico. When the rebels' victory became certain, the viceroy resigned. On August 24, 1821, representatives of the Spanish crown and Iturbide signed the Treaty of Córdoba, which recognized Mexican independence under the terms of the plan of Iguala.
On September 27, the Army of the Three Guarantees entered Mexico City. The next day, Iturbide proclaimed the independence of the Mexican Empire.
On the night of May 18, 1822, a mass of people marched through the streets. They demanded for Iturbide to accept the throne. The next day, the Congress declared Iturbide emperor of Mexico.