Spain's 74-year-old King Juan Carlos had successful hip replacement surgery, the royal palace said, after two operations on the other hip caused by a fall during a controversial African elephant-hunting safari.
"The operation, which lasted 90 minutes, was carried out under general anaesthetic and was completely satisfactory," the palace said.
The left-hip replacement surgery was needed because the king had been suffering from arthritis. He was kept in hospital overnight Friday for observation and doctors were to decide how much longer he needed to stay.
"Today I am definitely going into the workshop," the king joked to reporters as he entered the San Jose hospital in Madrid on Friday evening.
It was the sixth operation in two years for the king.
On April 14, Madrid surgeons reconstructed his right hip and inserted an artificial joint after the king fell over during a safari vacation in Botswana, breaking the bone in three places.
Though widely respected for his role in steering the country to democracy after the death of General Francisco Franco in 1975, the king was harshly criticised for his hunting trip.
Many were angered by the extravagance of the holiday, at a time when millions of Spaniards are suffering in the recession.