Hoping to isolate and weaken Britain economically through his Continental System, Napoleon launched an invasion of Portugal, the only remaining British ally in continental Europe. After occupying Lisbon in November 1807, and with the bulk of French troops present in Spain, Napoleon seized the opportunity to turn against his former ally, depose the reigning Spanish royal family and declare his brother King of Spain in 1808 as José I. The Spanish and Portuguese revolted with British support and expelled the French from Iberia in 1814 after six years of fighting.