Ferdinand VII, byname Ferdinand the Desired, Spanish Fernando el Deseado (born October 14, 1784, El Escorial, Spain—died September 29, 1833, Madrid), king of Spain in 1808 and from 1814 to 1833. Between 1808 and 1813, during the Napoleonic Wars, Ferdinand was imprisoned in France by Napoleon.

Ferdinand was the son of Charles IV and Maria Luisa of Parma, who placed their whole confidence in Manuel de Godoy. From 1795 Godoy had flaunted the title of prince of the Peace for his capitulation to France in the Peace of Basel. Ferdinand’s tutor stirred up his jealousy and encouraged him to seek the protection of Napoleon. Charles IV was sufficiently alarmed to arrest Ferdinand but forgave him. When Godoy allowed French troops to enter Spain, Charles was overthrown by the Revolt of Aranjuez (March 17, 1808), and he abdicated in favour of Ferdinand. However, French troops occupied Madrid, and Napoleon summoned Ferdinand to the frontier and obliged him to return the crown to his father, who granted it to Napoleon. Napoleon made his brother Joseph Bonaparte king of Spain and held Ferdinand in France for the duration of the war.

It was left to the Spanish populace to rise against the French invaders in the name of the absent Ferdinand, known as “the Desired.” In 1812 independent Spaniards adopted the Constitution of Cádiz, but in December 1813 Napoleon released Ferdinand expressly to overthrow it. When Ferdinand returned to Spain in 1814 he was urged by reactionaries to abolish the Cortes of Cádiz and all its works, which he did almost immediately. He resumed his obsolete powers and attempted to recover control of Spanish America, now partly independent. But his ministers could neither reinforce his armies in America nor persuade the British government to collaborate or connive at reconquest. In 1820 a liberal revolution restored the Constitution of 1812, which Ferdinand accepted, but in 1823 Louis XVIII of France sent the duc d’Angoulême at the head of a large army to release Ferdinand from his radical ministers. Ferdinand’s new government arrested the radicals or drove them into exile. By 1826 the Spanish possessions in America were all independent. Ferdinand’s government now depended on a militia, the Royalist Volunteers, and the French forces of occupation.

Ferdinand had no children from his three marriages, and his absolutist supporters looked to his even more absolutist younger brother, Don Carlos (Carlos María Isidro de Borbón), to succeed him. In 1830 his fourth wife, María Cristina, gave birth to a daughter, the future Isabella II. Isabella’s birth prompted Ferdinand to revoke the Salic Law of Succession, which prevented women from acceding to the throne. During Ferdinand’s illness, Don Carlos tried to persuade the queen to recognize his rights, but Ferdinand recovered, banished Don Carlos, and looked for moderate liberal support for his young daughter. When Ferdinand died in September 1833, Isabella was recognized as the sovereign, but his widow was obliged to lean on the liberals as Don Carlos asserted his claims from Portugal and thus began the First Carlist War.