In 1808, during the Spanish War of Independence he was taken captive by the French and imprisoned in El Escorial, from where he eventually escaped.
He traveled around England and the German states, and in 1814 he returned to Spain, right before the Spanish Constitution of 1812 was abolished by Fernando VII.
[citation needed] In 1819, the King was forming an army of ten battalions to fight in the Spanish American wars of independence.
After arriving in Cádiz, together with other liberal officers, he started a mutiny on 1 January 1820, demanding the return of the 1812 Constitution.
Riego's troops marched through the cities of Andalusia with the hope of starting an anti-absolutist uprising, but the local population was mostly indifferent.
Despite asking for clemency from the King, having approached religion and repented of his "constitutional crimes" during his imprisonment, completely retracting at the last minute his political convictions to the delight of the absolutists, Riego was found guilty of high treason against altar and throne, as he was one of the members of parliament who voted in favor of taking the power from the King.