On December 15, 1718 while he was serving as head of the army in Peru, he received the news that he had been named the first official viceroy of the recently created Viceroyalty of New Granada.
In November 1720, Spanish forces attacked the long-time Dutch settlement in Tucacas, on the coast of what is now Venezuela.
In 1721, following orders from the cabinet in Madrid, Villalonga expelled all foreigners, both residents and temporary visitors, not excluding men married to women born in the colony.
He improved the civil registry and aided in the foundation of the Jesuit college in the city of Santa Fe de Antioquia.
Viceroy Villalonga sent repeated recommendations to the Crown to abolish the viceroyalty and reestablish the earlier government under Peru, for the sake of economy.