Napoleonic invasion of Iberia

The Napoleonic invasion of the Iberian peninsula took place between 1807 and 1808. Napoleon had made an agreement with Russia at Tilsit on July 7, 1807. This allowed him to turn his attention toward the perfection of the Continental System against the British Empire. On July 19, 1807, Napoleon told the Portuguese to declare war on the British Empire and take part in the continental system. The answer of Portugal did not satisfy Napoleon, and he ordered Jean-Andoche Junot, a French general commanding a force of 30,000 men, to march through Spain to Portugal. The royal family of Portugal fled to Brazil, and Junot occupied Lisbon on November 30. The French army that conquered Portugal, however, also occupied parts of Spain. Unable to resist the French invasion, Charles IV of Spain decided to imitate the Portuguese royal family and escape to South America. However, a Spanish revolt on March 17, 1808, led to the abdication of Charles IV in favour of his son Ferdinand VII. Napoleon, taking advantage of the situation, sent in General Joachim Murat to conquer Madrid and the city was occupied on March 23, 1808. Subsequently, Napoleon forced Ferdinand to abdicate in favour of Charles and Charles in favour of his brother Joseph Bonaparte. On May 2, a revolt broke out against the occupiers, and the peninsula war had begun.