Spain former king criticised for meeting Saudi crown prince
The photo, which was released on the Twitter account of the Saudi foreign ministry (@KSAmofaEN), was published in several Spanish newspapers.
Conservative daily El Mundo ran it along with the headline: "The photo of shame".
A spokesman for the royal family said the former king shook hands with the de facto Saudi ruler at the Abu Dhabi Grand Prix on Sunday in what was a "greeting required by protocol, with no institutional significance and no previous meeting."
Far-left parties Podemos and Izquierda Unida which oppose the monarchy criticised the unexpected greeting.
"It is humiliating Spain and Spaniards," wrote Pablo Echenique, a leading member of Podemos, on Twitter.
Izquierda Unida leader Alberto Garzon questioned the Spanish royal family's friendships, saying on Twitter they are a "faithful reflection of an era that has to end".
"The Spanish monarchy is a problem not just for the Spanish people as this photograph shows. It's not a simple photo, it is a symbol," he added.
Juan Carlos, 80, has long had close ties with the Saudi royal family which has helped Spain to land lucrative contracts in the oil-rich kingdom.
He abdicated in 2014 after several scandals in favour of his son Felipe VI, who has tried to restore the monarchy's reputation.
In an online article, El Mundo said the former monarch "is obliged to... have a vision of the state and a sense of opportunity. And right now it is not appropriate to be photographed with the Saudi crown prince."
Saudi Arabia has faced intense global criticism over the killing of insider-turned-critic Khashoggi in its Istanbul consulate on October 2.
He was reportedly dismembered in what Saudi Arabia said was a "rogue" operation but CIA analysis leaked to the US media has pointed the finger at Prince Mohammed.
Riyadh has repeatedly and insistently rejected any suggestion the prince was connected to the killing.