A Spanish court has given the king's brother-in-law, Inaki Urdangarin, five days to report to jail after he lost his appeal against a graft conviction and prison sentence, a judicial source said Wednesday.

The former Olympic handball player and husband of Princess Christina has been sentenced to five years and ten months in jail in a case which caused uproar in Spain and tainted the royal family's image.

The 50-year-old had been found guilty last year of embezzling millions of euros between 2004 and 2006 from a non-profit foundation he headed on the island of Majorca.

On Wednesday, Urdangarin flew from Switzerland where he lives in exile with his family to Majorca to appear in court.

At the Palma courthouse he was met by a horde of journalists and some people who shouted "thief" at him, an AFP photographer reported.

Urdangarin will now be jailed in the next few days unless he makes a successful final appeal to the Constitutional Court - a possibility regarded as unlikely.

The graft case sparked outrage during Spain's financial crisis when Urdangarin came to be seen as a symbol of the elite's perceived corruption.

The scandal contributed to the decision of King Felipe VI's father Juan Carlos I to abdicate in 2014.