18 June 2014
Last updated at 23:41
Juan Carlos and his son hugged after the king had signed the law on his abdication
Felipe VI of Spain has acceded to the throne, following the abdication of his father Juan Carlos.
The retiring king helped introduce democracy after the death of dictator Gen Franco in 1975, but recently his reputation has been damaged by scandal.
At midnight (22:00 GMT) he handed over to his son, who will formally swear an oath in parliament later on Thursday.
Correspondents say ceremonies will be kept low key, at a time when many in Spain are suffering economic hardship.
The ceremony will take the form of a proclamation rather than a coronation. It will be the first royal transition in Spain since democracy was restored.
The new king will be proclaimed after promising to uphold the constitution and giving a speech to parliament.
He and his wife Letizia will then be driven through Madrid’s streets before appearing on the front balcony of the Royal Palace.
Correspondents say the new king faces a series of tough challenges if he is to restore the reputation of the monarchy.
Although Juan Carlos won plaudits for his role in restoring democracy, his image suffered when he went on the luxurious African elephant-hunting safari in the midst of a recession.
His reputation suffered further damage because of tax fraud allegations made against his daughter, Cristina, who is reported not to have been invited to the succession party.
At the same time many Spaniards are demanding a referendum on whether to have a monarchy at all – a demonstration is scheduled to take place in central Madrid on the same day as the enthronement, despite a ban imposed by authorities.
The BBC’s Chris Morris in Madrid says Felipe will face the dual challenge of trying to rehabilitate the monarchy and trying to unify a country in which a vocal minority favour republicanism.
The succession has been endorsed by both of Spain’s main political parties.