[2] Back in Spain, he joined the Regimiento Asturias, part of the expeditionary force, the Ejército Expedicionario de Ultramar, which had been quartered at Cádiz since 1816 in preparation for being sent over to America to quell the remaining rebellions.
[2] A mason, going under the name "Patria",[2][4] in July 1819, San Miguel, now a lieutenant colonel and active in a regiment that was especially noteworthy for supporting the revolutionary winds blowing across Spain, was arrested, together with other fellow officers, including Antonio Quiroga, Felipe del Arco-Agüero, Demetrio O'Daly and Antoine de Roten.
[5] He was held prisoner, along with his brother Santos and Arco Agüero, at the Castle of San Sebastián, in Cádiz,[2] from which they managed to escape the following January, a week after Rafael del Riego had announced his pronunciamiento.
[2] Quiroga, chosen by his fellow officers as head of the revolutionary movement, organized his forces in San Fernando where, faced by the Royalist troops led by José O’Donnell,[2] decided to resist in San Fernando, while the Columna Móvil, under the direct command of Riego, would deploy itself throughout Andalusia to garner support for the revolution, at the same time acting as a rearguard, if necessary.
[3] San Miguel was a prolific writer, publishing several works, as well as writing the lyrics to the Himno de Riego,[2] in honour of Rafael del Riego, which was declared the national anthem of Spain in 1822, remaining so until the overthrow of the liberal government the following year and would also become one of the popular anthems used in the First Spanish Republic (1873–1874) and, with even more prominence, during the Second Spanish Republic (1931–1939).