During the 1848 armistice with the Austrians, he traveled to Sicily where he participated in the Sicilian revolution of 1848 against the Bourbon dynasty, reaching the rank of colonel.
[2] He could not rejoin the Spanish army because the term of his license had expired, so he decided to travel to Mexico in 1853, although there is no record of a given reason.
[3] During the Peruvian Civil War of 1856–1858, he became involved in a conspiracy that ended with the death of General Carlos Varea, prefect of Cajamarca, which earned him a sentence of two years in prison.
[4][5][6] In 1861 he moved to Italy to fight for unification, however because his attempt to enlist had been extemporaneous, in accordance with the laws decreed for that purpose, he was not admitted to the Royal Italian Army.
Luigi Ghilardi was commissioned to deliver correspondence from Giuseppe Garibaldi to U.S. authorities in Washington D.C., as well as to President Benito Juárez in Mexico.
He arrived in New York City in May 1862 and managed to meet with the chargé d'affaires of the Mexican government in Washington, Matías Romero.
Ghilardi asked both of them to support the Mexican cause against the intervention due to the Monroe Doctrine however, because they were facing the American Civil War, they couldn't offer help.
In July 1863, he was appointed second chief of the command in Jalisco, at a time when the Mexican troops were trying to reorganize after the defeat suffered in Puebla.