In 1810 he traveled to Spain recommended by his older brothers Felipe Martin and Pedro Villamil, was received paternally by General Ignacio Alava, Governor of Cadiz, who invited numerous "soire".
The Governor's wife wanted to learn some dance steps and especially one called "L'Oiseleur" and Villamil taught it to her influence to obtain the release of several French officers who posed as luisianeses is not.
Villamil turned to warn of the danger, being chased by a brigantine and a schooner and as he passed the Punta de Piedra fort he asked them to fire and stop them.
Eight hours later the fleet appeared and Villamil received the order to position himself with a company in "a pampita" in front of the shore and from there he answered the fire with serious danger to his life.
On Saturday the 7th, the conspirators including the Peruvian lieutenant colonel Gregorio Escobedo, second in command of the garrison, decided to advance the revolution to the early hours of Monday the 9th, because the authorities were beginning to suspect that something was afoot.
On October 9 Guayaquil woke up free from Spanish rule and Villamil was acclaimed in the streets for being one of the main leaders of the revolution together with the Venezuelan officers Luis Urdaneta and León de Febres Cordero.
Villamil found him on the 31st anchored in the bay of Ancón and the next day he was presented to Libertador San Martín who gave him a horse and promoted him to Lieutenant Colonel, decorating him with the Order El Sol del Perú in the degree of Knight.
Upon his return Villamil brought 150 carbines; and received the medal of "Los Libertadores de Guayaquil" and the title of Lieutenant Colonel in November, after the installation of the Electoral College.
Later he commanded a battalion created to contain the royalists in Babahoyo and had as chief the Peruvian colonel Toribio Luzuriaga, sent by San Martín to support the independence of Guayaquil.
In 1822 she was part of the group of "Colombians" led by her sisters-in-law, the Garaycoa, and became close friends with the Liberator Simón Bolívar, whom she continually visited to read various works in French.
In 1833 he held the Consulate General of the United States in Guayaquil for a few months and traveled to the Galapagos as Governor of the Archipelago; there he exercised the position "with tact, sagacity and great practical spirit".
He returned to the Galapagos and with money loaned to his daughter Ana de Alarcón he moved the cattle on his property to avoid friction with the settlers of "Floreana".
There is a road 3,000 m long and 10 wide and it is projected to extend it to 400 m. There is a water spring that gives 80 gallons per hour and the water can be piped through bamboo pipes; but in 1833 President Flores ordered that the criminals be deported to the Galápagos and since then the colony has become a dangerous place.He attended the combats of "La Elvira" losing one of his ships in a shipwreck while transporting the troops and having claimed his amount from the National Congress, he only obtained that he be promoted to General of the Republic and the performance of the Customs administration of Manabí , where he had a romantic affair with Casimira Chávez, which gave him another daughter.