When did the Peninsular War take place ?
The outbreak of the Peninsular War in Spain and the capture of the Spanish king Ferdinand VII generated a political crisis in the Spanish colonies in the Americas .