In February 1696 he was named interim viceroy of New Spain, to succeed Gaspar de la Cerda, 8th Count of Galve.
A ship arrived in Veracruz on March 6, 1701, carrying the news of the death of King Charles II of Spain on November 1 of the previous year.
The War of the Spanish Succession, between Spain and France on the one hand and Austria, England and Holland on the other, began to determine his successor.
The viceroy received word that the conde de Chateau-Renaud had arrived in Havana with a French fleet to transport the tribute of New Spain to France.
Viceroy Ortega consulted with the Audiencia, and the decision was reached not to turn over the tribute to the French without express orders from the Spanish Crown.
On November 18, 1702, Archbishop Ortega left Mexico City for Otumba to welcome the new viceroy, Francisco Fernández de la Cueva, 10th Duke of Alburquerque, and turn over temporal power to him.
These included Informe del Estado de la Nueva España, written for his first successor, José Sarmiento y Valladares.