In 1808, Spain was invaded by French troops, and Napoleon forced the abdication of King Ferdinand VII of Spain in favour of the French emperor's brother Joseph Bonaparte, prompting the Spanish colonial government to oppose the new king. Many Mexicans became divided and formed secret organizations; some supporting King Ferdinand VIIX, and others desiring independence from Spain. It is impossible to say exactly when Hidalgo turned his thoughts towards rebellion against the colonial power, but the break is thought to have come sometime after Bonaparte replaced Ferdinand on the throne of Spain.
Organizations began to emerge, expressing a variety of radical views, discontented against the French political leadership; and issues of Spanish oppression in the Spanish Empire. Hidalgo y Costilla, a priest of unconventional views, attended one such provincial group in Guanajuato. It was there that educated criollos started conspiring for a large-scale uprising of mestizos and indigenous Amerindian peasants.
By 1809, Hidalgo's sense of discontent was turning openly into revolutionary politics, and the possibility of an uprising against the colonial government of what was then the Viceroyalty of New Spain. He was joined by Ignacio Allende, a career military officer from the nearby town of San Miguel, also a criollo, who was frustrated by the inherent chauvinism in the colonial administration, which preferred the advancement of Spaniards and foreign immigrants, rather than criollos born in Mexico, no matter how "pure" their blood. The fall of King Ferdinand VII of Spain created a void which Allende and other ambitious criollos were determined to fill.
On the late night of September 15, 1810, Hidalgo y Costilla and Allende received a message of warning from Josefa Ortiz de Domínguez, that the Spanish colonial authorities had intelligence of the rebellion, and were on the move. Just before the dawn of September 16, Hidalgo y Costilla rang the bells of his church in the village of Dolores. Many parishioners, indigenous Amerindians and mestizos had been coming in from the surrounding countryside, expecting to hear mass; instead they heard a call to arms. He made a speech known as Grito de Dolores ("Cry of Dolores"), in which he demanded independence. Hidalgo called on his people to expel all foreign invaders and rulers out of Mexico, so that Mexicans could govern their own country.
On the dawn of September 16, the rebel army moved on to the town of San Miguel el Grande (later renamed San Miguel de Allende),for gathering and support. The army then marched on to the city of Guanajuato, a major colonial mining center, where Antonio Riaño, the Spanish governor, attempted to organize a defensive strategy. But he was only able to assemble some 500 Creole and Spanish soldiers, against an Amerindian and mestizo army estimated at 20,000 soldiers. The town fell to the onslaught on September 28, during which many of the Spaniards and criollos were massacred at the Alhóndiga de Granaditas.
In the ensuing victory at the Battle of Monte de las Cruces, the rebel army then moved southeast towards Mexico City, to the region where General Félix Calleja had placed 3000 cavalry and 600 infantry at the pass of Las Cruces. The Spaniards managed to hold off the advance during two days of fighting, assisted by the fact that many of Hidalgo's men were poorly equipped, without firearms. Hidalgo y Costilla's soldiers were defeated by the heavily armed Spanish army, forcing the rebel survivors of the battle to seek refuge in nearby areas.
Calleja, with an enhanced army, followed in close pursuit, finally forcing Hidalgo y Costilla and Allende to make a stand on the banks of the Calderón River, where the Battle of the Bridge of Calderón was fought on the morning of January 16, 1811. Although small in numbers, Calleja's soldiers were still heavily armed. Hidalgo, moreover, had poorly organized his army, ignoring the advice of the more experienced Allende. Under sustained attack by the Spanish cavalry, infantry and artillery, the rebel army collapsed in panic, prompting a Spanish victory.
Allende had grown increasingly frustrated with Hidalgo y Costilla during the campaign, a mood that was compounded by the murderous indiscipline of the criollo, Amerindian and mestizo army. He promptly relieved his leader of command, and carried him northwards with his remaining force, towards the United States-Mexican border, where he hoped to buy arms. However, on March 21, they were betrayed and handed to the Spanish army, and taken prisoner.
Four leaders of the revolution, including Hidalgo y Costilla, Allende, José Mariano Jiménez and Juan Aldama, were held in the Federal Palace of Chihuahua. They were tried for treason, found guilty and executed by firing squad; Allende, Jiménez and Aldama on June 26, 1811 and Hidalgo on July 30, 1811 at Chihuahua's Government Palace. Prior to his death, Hidalgo thanked his jailers for their humane treatment of him and expressed regret for the bloodshed unleashed by the revolt, though he remained firm in his conviction that Mexico must be freed. The corpses of the four leaders were decapitated and their heads were placed on the four corners of the Alhóndiga de Granaditas in Guanajuato, with the intention of intimidating the insurgents. Following the death of Hidalgo, one of his surviving soldiers, José María Morelos y Pavón assumed leadership of the army and continued the war of independence.
Hidalgo and the other three leaders heads remained on display in Guanajuato until 1821, when Mexico finally won its independence. Hidalgo y Costilla's decapitated body was disinterred from his burial place in the San Francisco Temple in Chihuahua and re-buried in Mexico City after independence had been achieved.
Every year on the late night of September 15, just before the dawn of September 16, Mexico's president re-enacts the event by ringing the bells of the National Palace in Mexico City and repeats a cry of patriotism to all Mexicans, based upon the Grito de Dolores. September 16 is celebrated as Mexico's Independence Day.