On Thursday, Carlos, 75, received a permanent hip prosthesis in an operation to replace a temporary one implanted Sept. 24, TheLocal.es reported.
"His majesty the king received his discharge after completing the post-operative period very satisfactorily and having achieved sufficient autonomy for daily life," hospital manager Lucia Alonso told reporters.
"In the next weeks, Don Juan Carlos will continue with his treatment, post-operative checks and a planned outpatient recovery program," the hospital said.
Carlos is expected to be able to walk without the aid of crutches in 10-12 weeks, the hospital said.
Notable deaths of 2014 [PHOTOS]
U.N. investigator: prosecute North Korea