 By 1814, after scores of battles and sieges throughout Iberia, the Allies had managed to push the French out of the peninsula.The impact of the Napoleonic invasion of Spain and ousting of the Spanish Bourbon monarchy in favour of his brother Joseph had an enormous impact on the Spanish empire.In Spanish America many local elites formed juntas and set up mechanisms to rule in the name of Ferdinand VII of Spain, whom they considered the legitimate Spanish monarch.