Answer:
In 1807 Spain's problems were compounded when Napoleon Bonaparte's troops entered the Iberian Peninsula. Initially Spain was an ally of France and Napoleon sought co-operation from Spain for his invasion of Portugal. The Spanish monarchy co-operated because it hoped to secure Southern Portugal for itself.
Step-by-step explanation:
Joseph could count on the support of cautious, legalistic administrators and soldiers, those who believed resistance to French power impossible, and those who considered that Napoleon might “regenerate” Spain by modern reforms. These groups became convinced afrancesados, as members of the pro-French party were pejoratively called. Relying on their support, Napoleon entirely underestimated the possibility of popular resistance to the occupation of Spain by French armies. Although the uprising of May 2, 1808, in Madrid was suppressed, local uprisings against the French were successful wherever French military power was weak.