 In 1808 Napoleon invaded Spain, forced Ferdinand VII, King of Spain, to abdicate, and installed his brother Joseph Bonaparte as King.Resistance to the French invasion coalesced in a national government, the Cortes of Cádiz.This government then entered into an alliance with Great Britain against France.