In 1808, Napoleon made a second costly mistake. In an effort to get Portugal to accept the Continental System, he sent an invasion force through Spain. The Spanish people protested this action. In response, Napoleon removed the Spanish king and put his own brother, Joseph, on the throne. For six years, guerillas struck at French armies in Spain. Napoleon lost about 300,000 men. These losses weakened the French Empire.