In 1975, Otto von Habsburg was declared Head of State in accordance with the wishes of the late Francisco Franco.
Otto von Habsburg, King of SpainBecause in 1961, the Spanish dictator had offered to make him king of Spain after his own death. A branch of the Habsburg had ruled the country from 1506-1700 and so a valid (if some tenuous) claim existed based on historical precedent. However, Franco's concern was maintaining his own legacy by preventing the ascension of Juan Carlos.
But of course the Carlist and Alfonsian branches of the Royal Family both contested the succession which received only half hearted supported from the people of Spain. Within a very short space of time, it became clear that the country was heading for a disastrous second Civil War if von Habsburg could not safely navigate the nation towards a democratic safe haven.