 Spain temporarily broke off from the Continental System, and Napoleon – irritated with the Bourbon kings of Spain – invaded Spain in 1808 and deposed Ferdinand VII, who had been on the throne only forty-eight days after his father's abdication in March 1808.On July 20, 1808, Joseph Bonaparte, eldest brother of Napoleon Bonaparte, entered Madrid and established a government by which he became King of Spain, serving as a surrogate for Napoleon.The former Spanish king was dethroned by Napoleon, who put his own brother on the throne.