The Spanish monarchy had been tearing itself apart for months: Charles IV, his favourite Godoy and the heir Ferdinand were disputing the throne after the Aranjuez riot. Napoleon, whose troops already occupied the country on the pretext of marching to Portugal, offered to arbitrate and summoned them to the château of Marracq, near Bayonne. They all came, of their own free will.
The mechanism was settled in three weeks. Ferdinand VII returned the crown to his father on 6 May; Charles IV ceded it to Napoleon the next day for a pension and the château of Compiègne. On 6 June Joseph Bonaparte was proclaimed King of Spain. An assembly of Spanish notables convened on the spot adopted in July the Bayonne Constitution, a reform text drafted in French.
While the royal family was negotiating its surrender, Madrid had risen. On 2 May the insurrection broke out; Murat crushed it that night, with firing squads Goya would paint six years later. The news reached Bayonne in the middle of the talks and did not interrupt them — it only made them more urgent.
The calculation was legally impeccable and politically disastrous. It assumed a nation would follow its dynasty; Spain did exactly the opposite. Six years of war, three hundred thousand men swallowed up, the first defeat of an imperial army at Bailén. At Saint Helena he made the plainest admission of his memoirs: that wretched Spanish war destroyed him.