King Juan Carlos, Queen Sofia and Infanta Elena photographed earlier this year. | EFE

King Juan Carlos of Spain, 81 and the father of the current head of state King Felipe VI, will undergo heart surgery tomorrow, a spokesperson for the royal family said yesterday.

Doctors scheduled the operation back in June after a regular check-up on Juan Carlos, who retained the title of emeritus King after his abdication in 2014. He will be operated on at the Quiron Hospital in Madrid.

In May, Juan Carlos announced his decision to withdraw from public life, ceasing his remaining institutional functions and appearances from June.

The king played a critical role guiding Spain to democracy after the death of dictator Francisco Franco, but his 40-year reign was tarnished in later years by accusations he was out of touch with ordinary people, especially during the economic crisis in 2008-14.