Juan José Rafael Teodomiro de O'Donojú y O'Ryan (Spanish pronunciation: [ˈxwan de oˌðonoˈxuj ˌoˈraʝan] , 30 July 1762 – 8 October 1821) was a Spanish-Irish military officer, diplomat and Viceroy of New Spain from 21 July 1821 to 28 September 1821 during the Mexican War of Independence. He was the last Viceroy of New Spain.
He was appointed viceroy during the last stages of the Mexican War of Independence with the hopes of accommodating the Mexican independence movement, but upon his arrival to New Spain in August, 1821 O’Donoju found that the overwhelming majority of the nation had already been lost. He officially recognized Mexican independence through the Treaty of Córdoba, but died of pleurisy shortly after. His recognition of Mexican independence was disowned by the Spanish government which would not officially recognize the Mexican government until 1836.