Ferdinand entered Madrid on the 24th, found the French general in command of the capital, and in vain claimed his recognition as king. Napoleon heard with regret of the action of Murat, who had risked arousing the pride and anger of the Spaniards. He therefore sent Savary, in whose practiced skill he hoped to find a remedy for the military rashness of Murat, and who was to assume the chief direction of affairs at Madrid.

Ferdinand was at length persuaded by Savary that his best chance of securing the aid and protection of Napoleon lay in meeting him on his way to the Spanish capital and strive to gain his ear before the emissaries of Godoy should be able to make an impression concerning Charles' rights. Ferdinand, therefore, took his departure, and passing the frontier, arrived at Bayonne on the 20th of April where he was received by Napoleon with courtesy. In the evening he was informed by Savary, who had accompanied him, that his doom was sealed,—"that the Bourbon dynasty had ceased to reign in Spain," and that his personal safety must depend on the readiness with which he should resign all his pretensions into the hands of Napoleon.

Murat was now directed to employ means to have the old king and queen repair also to Bayonne, which they did, arriving there on May 4th. Following a bitter family quarrel, Charles IV. resigned the crown of Spain for himself and his heirs, accepting in return from the hands of Napoleon a safe retreat in Italy and a splendid mansion. At the first interview Charles IV. and his son were irrevocably judged. "When I beheld them at my feet," Napoleon said later, "and could judge of all their incapacity, I took pity on the fate of a great nation; I seized the only opportunity which fortune presented me with, for regenerating Spain, separating her from England and closely uniting her with our system." A few days afterward Ferdinand VII. followed the example of his father and executed a similar act of resignation.

A suspicion that France meditated the destruction of the national independence in Spain now began to spread, and on the 2nd of May when Don Antonio, president of the Council of Regency at Madrid, and uncle of Ferdinand, began preparations for departing from the capital, the inhabitants became much enraged. A crowd collected around the carriage intended, as they concluded, to convey the last of the royal family out of Spain; the traces were cut and imprecations heaped upon the French. Colonel La Grange, Murat's aide-de-camp, happening to appear on the spot, was cruelly maltreated, and in a moment the whole capital was in an uproar. The French soldiery were assaulted everywhere, about seven hundred being slain. The French cavalry, hearing the tumult, entered the city and a bloody massacre ensued. Many hundreds were made prisoners. The troops then charged through the streets from end to end, released their comrades, and ere nightfall had apparently restored tranquility. Murat ordered all the prisoners to be tried by a military commission, which doomed them to instant death.

The reports of the insurrection spread rapidly throughout the peninsula, and in almost every town in Spain depredations were committed against the French citizens, many of the acts being fomented by agents of England, whose navies hung along the coast inflaming the passions of the multitude.

Napoleon received this intelligence with alarm, but he had already gone too far to retreat. He proceeded, therefore, to act precisely as if no insurrection had occurred. Tranquility being re-established in Madrid the Council of Castile was convoked and Napoleon's brother Joseph was chosen by an imperial decree as their ruler. Ninety-five notables met him in Bayonne and swore fealty to him and a new constitution. Joseph on entering Spain was met by many demonstrations of disapproval and hatred, but the main road being occupied with Napoleon's troops, he reached Madrid in safety.

England now became anxious to afford the Spaniards every assistance possible. On the 4th of July the king addressed the English parliament on the subject, declaring that Spain could no longer be considered the enemy of Great Britain, but was recognized by him as a natural friend and ally. Supplies of arms and money were liberally transmitted thither, and Portugal, catching the flame, and bursting into general insurrection, a treaty of alliance, offensive and defensive was soon concluded between England and the two kingdoms of the peninsula.

It was impossible for Napoleon to concentrate the whole of his gigantic strength of 500,000 men on the soil of Spain, as his relations with those powers on the Continent whom he had not entirely subdued, were of the most unstable character. His troops, moreover, being drawn from a multitude of different countries and tongues, could not be united in heart or discipline like the soldiers of a purely national army. On the other hand the military genius at his command had never been surpassed in any age or country. His officers were accustomed to victory, and his own reputation exerted a magical influence over both friends and foes.