During the Napoleonic Wars, Cádiz was blockaded by the British from 1797 until the Peace of Amiens in 1802 and again from 1803 until the outbreak of the Peninsular War in 1808. In that war, it was one of the few Spanish cities to hold out against the invading French and their candidate Joseph Bonaparte. Cádiz then became the seat of Spain's military high command and Cortes (parliament) for the duration of the war. It was here that the liberal Spanish Constitution of 1812 was proclaimed. The citizens revolted in 1820 to secure a renewal of this constitution and the revolution spread successfully until Ferdinand VII was imprisoned in Cádiz. French forces secured the release of Ferdinand in the 1823 Battle of Trocadero and suppressed liberalism for a time. In 1868, Cádiz was once again the seat of a revolution, resulting in the eventual abdication and exile of Queen Isabella II. The Cortes of Cádiz decided to reinstate the monarchy under King Amadeo just two years later.