|Jefe Político Superior|
|Monarch||Ferdinand VII of Spain|
3 August de 1821 - 27 September 1821
|Juan Ruiz de Apodaca, 1st Count of Vendetta|
|Agustín de Iturbide (President of the Regency of the Mexican Empire)|
|Regent of the Mexican Empire|
28 September 1821 - 8 October 1821
(as Jefe Político Superior)
|Agustín de Iturbide|
|Prime Minister of Spain|
10 October 1813 - 17 October 1813
|Mariano Luis de Urquijo|
|Fernando de Laserna|
|Born||30 July 1762|
Seville, Kingdom of Spain
|Died||8 October 1821 (aged 59)|
Mexico City, First Mexican Empire
Juan de O'Donojú y O'Ryan (Spanish pronunciation: ['xwan de o?ðono'xu i ?o'ra?an] (1762 – 8 October 1821) was a Spanish military officer and "Jefe Político Superior" ("viceroy") of New Spain from 21 July 1821 to 28 September 1821 during the Mexican War of Independence. He was the last Spanish ruler of New Spain.
O'Donoju was the Chief of Staff to General Gregorio García de la Cuesta during the Battle of Talavera (27 and 28 July 1809). On 11 July 1809, O'Donojú served as an interpreter between Cuesta and the British commander, Lieutenant-General Sir Arthur Wellesley (later created, in May 1814, The 1st Duke of Wellington), as the two met to make their campaign plans. The meeting was somewhat strained as Cuesta answered many of Wellesley's questions with a simple "yes" or "no" which O'Donojú tactfully explained.
O'Donoju was a friend of the liberal rebel Rafael del Riego. In 1820, at the time of the re-establishment of the Spanish Constitution of 1812, O'Donoju was the captain general of Andalusia. O'Donoju reached the rank of lieutenant general and was a high officer in the Spanish Freemasons. In 1821, the Cortes Generales appointed him captain general and "jefe político superior", which gave him the authority (but not the official title) of the former viceroys. At the time O'Donojú left for New Spain, the Cortes was considering to greatly expand the autonomy granted to the overseas Spanish possessions according to the restored constitution.
O'Donoju was sworn into his new offices upon his arrival in Veracruz on 21 July 1821. He found that the entire country except for Veracruz, Mexico City and Acapulco supported the Plan de Iguala and the rebel general, Agustín de Iturbide.
On 3 August 1821, in Veracruz, O'Donoju issued a proclamation of his liberal principles to the people of Mexico. He wrote to Iturbide, inviting him to a conference in a location of his choosing. Iturbide chose the city of Córdoba as the meeting place. O'Donojú, accompanied by Colonel Antonio López de Santa Anna, arrived there on 23 August, and the following day the meeting occurred. The men reached an agreement and signed an accord, the Treaty of Córdoba, based on the Plan de Iguala. The only part of the Plan de Iguala that was amended was Article 4, concerning the functions of the governmental junta. The new Article 4 also provided that if no member of the Bourbon family accepted the crown of New Spain (a likely possibility), the Mexican Cortes would freely elect their monarch. Under the circumstances, that effectively granted the crown to Iturbide.
The military leaders of the Spanish in the colony did not accept independence. Spanish troops occupied the plazas of Mexico City and Veracruz, the fort of San Carlos de Perote, and the castle of San Diego in Acapulco. They were blockaded and all but Veracruz was surrendered. Francisco Novella was besieged in Mexico City by the Army of the Three Guarantees (the unified pro-independence army formed by the Plan de Iguala), led by Vicente Guerrero and Nicolás Bravo. Novella agreed to a suspension of hostilities. Colonel Santa Anna besieged Brigadier García Dávila in San Juan de Ulúa, Veracruz, but the latter was able to hold out for four more years.
O'Donojú used his influence to withdraw Spanish troops from the country with a minimum of bloodshed through reasonable surrender terms. He then approved the promotion of Novella, the previous acting viceroy, to field marshal.
On 13 September 1821, O'Donojú met with Novella and Iturbide at the Hacienda de la Patera, near the Villa de Guadalupe, smoothing over the difficulties and arranging the details of the transfer of power. Novella ordered Spanish troops to leave Mexico City.
The insurgents entered the capital on 24 September 1821, two days after the Spanish troops left Mexico City. On 27 September 1821, O'Donojú and, on 28 September 1821, Iturbide decreed the independence of the Mexican Empire from Spain. Together with thirty-three others, O'Donojú was a member of the Provisional Governing Junta, headed by Iturbide. O'Donoju signed the Act of Independence on 28 September 1821.
On 3 October 1821, the Captaincy General of Guatemala (formed of Chiapas, Guatemala, El Salvador, Nicaragua, Costa Rica, and Honduras) proclaimed its independence from Spain and its incorporation into the Mexican Empire. The region had been formally subject to New Spain throughout the colonial period, but as a practical matter, it was administered separately. All but Chiapas soon separated from Mexico.
O'Donojú died of pleurisy in Mexico City on 8 October 1821; some historians suspect that he was poisoned by Iturbide. The suspicion is based on the declarations of Carlos María Bustamante, a parliamentarian and writer. O'Donoju's remains were interred with the honors of a viceroy in the vault of the Altar of Kings in the Cathedral of Mexico.