He was named viceroy of New Spain by Philip V in 1740 to replace Juan Antonio de Vizarrón y Eguiarreta. The Dutch merchant ship transporting him to New Spain was taken by an English frigate near Puerto Rico, but he was able to launch a boat and, together with some other passengers, avoid being captured. He did, however, lose all of his luggage, including his credentials and the royal orders and instructions, therefore, arriving in San Juan, Puerto Rico without papers. He then made his way to Veracruz, where he arrived on June 30, 1740. From Veracruz he wrote to the archbishop of Mexico, who recognized him as the new viceroy. He made his formal entry into Mexico City on August 17, 1740.