Yet all the powers seemed united in the same design. England was placed under the ban of continental Europe, at the peace. Russia and Denmark in the Northern Seas; France, Spain, and Holland, in the Mediterranean and the ocean, were obliged to declare against it. This period was the height of the imperial sway. Napoleon employed all his activity and all his genius in creating maritime resources capable of counter-balancing the forces of England, which had then eleven hundred ships of war of every class. He caused ports to be constructed, coasts to be fortified, ships to be built and prepared, everything for combating in a few years upon this new battle-field. But before that moment arrived, he wished to secure the Spanish peninsula, and to found his dynasty there, for the purpose of introducing a firmer and more favourable policy. The expedition of Portugal in 1807, and the invasion of Spain in 1808, began for him and for Europe a new order of events.
Portugal had for some time been a complete English colony. The emperor, in concert with the Bourbons of Madrid, decided by the treaty of Fontainebleau, of the 27th of October, 1807, that the house of Braganza had ceased to reign. A French army, under the command of Junot, entered Portugal. The prince-regent embarked for Brazil, and the French took possession of Lisbon on the 30th of November, 1807. This invasion was only an approach towards Spain. The royal family were in a state of the greatest anarchy. The favourite, Godoy, was execrated by the people, and Ferdinand, prince of the Asturias, conspired against the authority of his father's favourite. Though the emperor had not much to fear from such a government, he had taken alarm at a clumsy armament prepared by Godoy during the Prussian war. No doubt, at this time he formed the project of putting one of his brothers on the throne of Spain; he thought he could easily overturn a divided family, an expiring monarchy, and obtain the consent of a people whom he would restore to civilization. Under the pretext of the maritime war and the blockade, his troops entered the peninsula, occupied the coasts and principal places, and encamped near Madrid. It was then suggested to the royal family to retire to Mexico, after the example of the house of Braganza. But the people rose against this departure; Godoy, the object of public hatred, was in great risk of losing his life, and the prince of the Asturias was proclaimed king, under the title of Ferdinand VII. The emperor took advantage of this court revolution to bring about his own. The French entered Madrid, and he himself proceeded to Bayonne, whither he summoned the Spanish princes. Ferdinand restored the crown to his father, who in his turn resigned it in favour of Napoleon; the latter had it decreed on his brother Joseph by a supreme junta, by the council of Castille, and the municipality of Madrid. Ferdinand was sent to the Chateau de Valencay, and Charles VI. fixed his residence at Compiegne. Napoleon called his brother-in-law, Murat, grand- duke of Berg, to the throne of Naples, in the place of Joseph.
At this period began the first opposition to the domination of the emperor and the continental system. The reaction manifested itself in three countries hitherto allies of France, and it brought on the fifth coalition. The court of Rome was dissatisfied; the peninsula was wounded in its national pride by having imposed upon it a foreign king; in its usages, by the suppression of convents, of the Inquisition, and of the grandees; Holland suffered in its commerce from the blockade, and Austria supported impatiently its losses and subordinate condition. England, watching for an opportunity to revive the struggle on the continent, excited the resistance of Rome, the peninsula, and the cabinet of Vienna. The pope had been cold towards France since 1805; he had hoped that his pontifical complaisance in reference to Napoleon's coronation would have been recompensed by the restoration to the ecclesiastical domain of those provinces which the directory had annexed to the Cisalpine republic. Deceived in this expectation, he joined the European counter-revolutionary opposition, and from 1807 to 1808 the Roman States became the rendezvous of English emissaries. After some warm remonstrances, the emperor ordered general Miollis to occupy Rome; the pope threatened him with excommunication; and Napoleon seized on the legations of Ancona, Urbino, Macerata, and Camerino, which became part of the Italian kingdom. The legate left Paris on the 3rd of April, 1808, and the religious struggle for temporal interests commenced with the head of the church, whom Napoleon should either not have recognised, or not have despoiled.
The war with the peninsula was still more serious. The Spaniards recognised Ferdinand VII. as king, in a provincial junta, held at Seville, on the 27th of May, 1808, and they took arms in all the provinces which were not occupied by French troops. The Portuguese also rose at Oporto, on the 16th of June. These two insurrections were at first attended with the happiest results; in a short time they made rapid progress. General Dupont laid down arms at Baylen in the province of Cordova, and this first reverse of the French arms excited the liveliest hope and enthusiasm among the Spaniards. Joseph Napoleon left Madrid, where Ferdinand VII. was proclaimed; and about the same time, Junot, not having troops enough to keep Portugal, consented, by the convention of Cintra, to evacuate it with all the honours of war. The English general, Wellington, took possession of this kingdom with twenty-five thousand men. While the pope was declaring against Napoleon, while the Spanish insurgents were entering Madrid, while the English were again setting foot on the continent, the king of Sweden avowed himself an enemy of the European imperial league, and Austria was making considerable armaments and preparing for a new struggle.