The Mexican War of Independence (Guerra de Independencia de México, 16 September 1810 – 27 September 1821) was an armed conflict and political process resulting in Mexico's independence from Spain. It was not a single, coherent event, but local and regional struggles that occurred within the same period, and can be considered a revolutionary civil war. It culminated with the drafting of the Declaration of Independence of the Mexican Empire in Mexico City on September 28, 1821, following the collapse of royal government and the military triumph of forces for independence. Those forces were led by former royalist commander Agustín de Iturbide, who united with insurgent leader Vicente Guerrero under the 1821 Plan of Iguala. Mexican independence from Spain was not an inevitable outcome of the relationship between the Spanish Empire and its most valuable overseas possession, but events in Spain had a direct impact on the outbreak of the armed insurgency in 1810 and the course of warfare through the end of the conflict. Napoleon Bonaparte's invasion of Spain in 1808 touched off a crisis of legitimacy of crown rule, since he had placed his brother Joseph on the Spanish throne after forcing the abdication of the Spanish monarch Charles IV. In Spain and many of its overseas possessions, the local response was to set up juntas, ruling in the name of the Bourbon monarchy. Delegates in Spain and overseas territories met in Cádiz, Spain, a small corner of the peninsula still under Spanish control, as the Cortes of Cádiz, and drafted the Spanish Constitution of 1812. That constitution sought to create a new governing framework in the absence of the legitimate Spanish monarch. It tried to accommodate the aspirations of American-born Spaniards (criollos) for more local control and equal standing with Peninsular-born Spaniards, known locally as peninsulares. This political process had far-reaching impacts in New Spain during the independence war and beyond.