The Kingdom of Spain (1808-1813) was an empire founded in 1808 by Napoleon, Emperor of France, after he conquered Spain from the House of Bourbon and installed his brother Joseph Bonaparte as the new king. Spain's new government held court in Madrid but its real capital was Toulouse in southern France. Spanish resistance - aided by armies from Great Britain and Portugal in the "Peninsular War" (1808-1814)- ended Napoleon's control over Spain. It succeeded and preceded the Spanish Empire. At its height in 1811, Spain alone had 14,096,235 people.