The 75-year-old monarch left the Quiron University Hospital today, smiling and waving to reporters as he was driven away.
The king had a hip prosthesis removed September 24 after it developed an infection. He went in for replacement surgery last Thursday.
The monarch's popularity has dipped in recent years following scandals, including an elephant shooting trip in the middle of Spain's financial crisis that tarnished the royal family's image.
His son-in-law, Inaki Urdangarin is also under investigation on suspicion of having embezzled large sums in public contracts.