In 1698, Charles II, the last Habsburg king of Spain, named him ambassador to the court of Louis XIV in Paris.
He it was who informed the French king that Charles had named the Duke of Anjou as his heir, with the words Señor, desde este momento no hay Pirineos ("Lord, from this moment there are no more Pyrenees.").
He was able to send back an enormous sum of money (1,600,000 pesos) to the king to cover some of the costs of the war.
The collection of the money caused many protests, especially among the merchants, who brought suit against the viceroy many times in the Tribunal del Consulado.
To this problem were added others: the increase in French contraband and the English attacks on the coast, especially those of Charles Wager and Thomas Colb in 1708 and those of Woodes Rogers between 1709 and 1711.
This was not a success, because the treasure ships he sent back from Panama to Spain thereby lost the protection of the French and were vulnerable to the English established in Jamaica.
Miguel Núñez de Sanabria, president of the Audiencia of Lima took over governmental functions on an interim basis.