The 76-year-old king, hurt by royal scandals in the twilight of a reign that steered Spain from dictatorship to democracy, is handing the crown to his son Felipe who is expected to be sworn in on Thursday.
But when King Felipe VI is crowned, his father Juan Carlos will cease to be covered by Spain's 1978 constitution, which states that the person of the king "is inviolable and shall not be held accountable".
In October 2012, that immunity thwarted two legal suits demanding that Juan Carlos undergo paternity tests to show whether he was the father of two extramarital children.
It is a status that is increasingly being questioned, however, as Spain grapples with the first royal succession since the restoration of the monarchy after the death of General Francisco Franco in 1975.
Juan Carlos himself declared in a televised address in December 2012 that "justice is equal for all" as he distanced himself from a corruption scandal swirling around his son-in-law, former Olympic handball champion Inaki Urdangarin.
This year, the king's younger daughter Princess Cristina was officially named a tax crime suspect in relation to her husband's allegedly dodgy business practices.
There has been no suggestion that the king is linked to Urdangarin's affairs but the monarch's popularity has nevertheless been hit by that scandal and by his own exploits, in particular a luxury 2012 African elephant-hunting safari that shocked many Spaniards.
Juan Carlos's legal status thus poses a unique challenge to Prime Minister Mariano Rajoy's conservative government.
Deputy Prime Minister Soraya Saenz de Santamaria said this month that the government would propose to parliament a fundamental law setting out the king's legal status after his abdication.
Immunity for life
In any case, she said, Juan Carlos's constitutional immunity for actions taken while king will not expire.
"One loses immunity for the future, but that does not mean one regains responsibility for previous acts," the deputy premier told journalists.
A spokesman for Spain's General Council of the Judiciary said legal opinion broadly supported the view that the king's immunity for the period of his reign remains intact.
But that claim is "pretty debatable", argued Joaquim Bosch, spokesman for one of the judiciary's professional associations, Judges for Democracy.
"The constitution absolutely does not say that after abandoning his functions as head of state, the inviolability remains," Bosch said.
Parliament could extend a new legal privilege to the king for actions taken after his abdication.
Already, an estimated 10,000 Spanish members of parliament, judges, prosecutors and members of the government are afforded a legal privilege for actions taken as part of their official duties, a figure Bosch criticised as excessive.
The privilege means only the Superior Court may judge regional figures such as members of a regional parliament while only the Supreme Court may judge national figures such as members of the Spanish parliament or central government ministers.
"I think someone who has held the highest office of state should have some special consideration but the decision is up to the government and parliament," said state prosecutor Eduardo Torres-Dulce.
One judicial source said the government may decide to include Felipe VI's parents in a law that would extend immunity to the king and his spouse for life.
Francisco Martinez, spokesman for the National Commission of Senior Judges, has said, however, that it "seems logical" the king should lose his protection when he no longer sits on the throne.
Pedro Sanchez, a leading member of Spain's opposition Socialist Party, said this week it was time to debate which royal privileges should be eliminated "and one of them is undoubtedly ending the principle of the inviolability of the king".