The King's wife Queen Sofia of Spain was calm and collected when she was pictured outside the hospital, clearly relieved the operation had been completed successfully.
Dressed casually, she was smiling and chatting with her son Prince Felipe and his wife Princess Letizia, and her daughter Princess Elena of Spain.
The monarch, 75, was admitted at the Quiron Madrid Hospital on the outskirts of the Spanish capital for his left hip to be replaced.
U.S. surgeon Robert Trousdale of the Mayo Clinic in Minnesota flew to Spain especially to carry out the surgery, alongside Dr. Miguel Cabanela.
The King will have to undergo a second operation within the next two months to implant a new, permanent artificial left hip, as the one inserted on Tuesday was a temporary measure following infection in the tissue surrounding the artificial hip.
King Juan Carlos working at Zarzuela Palace hours before entering hospital for hip surgery
According to Dr. Miguel Cabanela, Juan Carlos will be taking antibiotics intravenously for the next six weeks.
Once his second surgery is completed successfully, he will have to use crutches for the same period.