Portugal, in consequence of her refusal to close her ports against the English, was occupied by a French army under Junot, who assumed the title of Duke of Abrantes, and proclaimed himself regent in the name of the French Emperor, after the departure of the Portuguese royal family for Brazil. In pursuance of his favorite object, the destruction of English commerce, Napoleon not only extended his continental system to Portugal and Italy (as far as the latter country was dependent on France), but even formed a plan for the subjugation of Spain; and under pretense of protecting that country against an English invasion, crossed the Pyrenees at the head of 100,000 men. Charles IV, who a short time before in consequence of an insurrection against his contemptible favorite, Godoy, Prince of the Peace, had resigned his crown in favor of his son, Ferdinand VII, no sooner witnessed the entry of the French into Madrid, than he desired to recall his abdication. Under pretense of settling the dispute, Napoleon invited the whole party to meet him at Bayonne, and having made himself master of their persons, compelled the Bourbon family to resign the Spanish crown and placed his brother Joseph on the throne. The vacant kingdom of Naples was then conferred on Murat, and the grandduchy of Berg destined for the Crown Prince of Holland. Against the sovereign thus treacherously imposed on them, the whole Spanish nation rose as one man; and Joseph, after an unsuccessful attempt to conciliate his new subjects by granting them a liberal constitution, was compelled to quit Madrid and retire to Burgos.
An English army, commanded by Sir Arthur Wellesley, landed in Portugal, and drove the French out of that country; the means of returning to France being secured to Junot and his army by the Convention of Cintra. At the same time, another French army, under Dupont, was surrounded and captured in the south of Spain. The French had already. fallen back on the Ebro, when Napoleon (to whom the Emperor Alexander, in a personal interview at Erfurt, had promised assistance in the event of a war with Austria) appeared in Spain at the head of 335,000 men.
After a victorious progress from the Ebro, the French Emperor entered Madrid, and immediately abolished the inquisition, the feudal system, and the Council of Castile (which had recalled its consent to the abdication of Charles IV), and reduced the number of convents to one-third. Having, in conjugation with Soult, compelled the English to evacuate Portugal, Napoleon returned to France to make preparations for a fresh war with Austria. On the 21st February, 1809, the fortress of Saragossa which had been twice heroically defended by the Spanish General Palafox, with the loss of 53,000 men, surrendered to the French; and the cause of Spanish independence seemed utterly ruined; for the brilliant victory of Talavera 27th and 28th of July, obtained by Sir Arthur Wellesley over King Joseph, was neutralized by the defeat of an army recently raised by the Junta of Seville, with was almost annihilated by Soult, at Ocano.
The monks, to whose influence King Joseph attributed the general insurrection of the Spanish nation against the French, were punished by the suppression of all the monastic orders. Whilst the French, although perpetually harrassed by swarms of irregular troops, called Guerillas, were still advancing steadily towards the south, the Junta had retired to Seville, and assembled the Cortes (1810), which drew up and proclaimed in (1812), a new constitution, by which the monarchical power was greatly restricted. The repeated attempts of the French, especially under Massena, to regain a footing in Portugal, were as unsuccessful as their attacks on Cadiz which was strongly fortified and protected by a combined Spanish and English fleet. In the year 1812, the French force in Spain having been reduced to 168,000 men, by the withdrawal of a large number of the best soldiers and generals for the Russian campaign, the whole population of several provinces were encouraged to take the field, and the Guerillas under Mina, the Curate Merino, Mendizabal, etc., became daily more numerous and daring. The fortresses of Ciudad Rodrigo and Badajoz were stormed by Lord Wellington, who spared the armies of Marmont and Soult, defeated the former near Salamanca, compelled Joseph to quit Madrid, and then, on the approach of the French, retreated to the Portuguese frontier. Soult having been recalled from Spain by Napoleon, after his disastrous campaign in Russia, the English general compelled King Joseph a second time to abandon his capital, and retire to the Ebro, and in the year 1813 decided the fate of Spain, by a brilliant victory over Jourdan at Vittoria. Joseph escaped being taken prisoner, by a precipitate flight into France. Soult, who had . reentered Spain by command of Napoleon, was compelled to recross the Pyrenees by Lord Wellington, and the war was terminated by the battle of Toulouse, in April, 1814, the Emperor Napoleon having previously abdicated, and Ferdinand VII being released from his imprisonment at Valencay.