The 75-year-old king has a herniated disc in his lower back for which "the most suitable treatment is a surgical operation", the palace's head doctor Miguel Fernandez Tapia-Ruano said in a statement on Thursday.
Juan Carlos is widely respected for his role in steering Spain to democracy after the death of the dictator General Francisco Franco in 1975.
But over the past two years he has suffered health problems as well as rare scandals, including a corruption investigation targeting his son-in-law Iñaki Urdangarin.
Juan Carlos has appeared on crutches over recent months after having both hips replaced in three operations last year.
The first of those came after he fell during an elephant-hunting holiday in Botswana.
Sympathy for his injury was overshadowed by popular anger that he made the luxury trip while Spaniards were suffering in a recession.
The king had a benign tumour removed from a lung in May 2010. In 2011 he was given an artificial right knee and had a torn Achilles tendon repaired.
Despite his operations and opinion polls showing his popularity plunged last year, the king insisted in a televised interview last month that he had "energy and hope" to continue ruling.
The palace doctors said last week that the slipped disc was an "old" injury that they had found to have worsened.
The operation will take place on March 3 in La Milagrosa, a clinic in central Madrid, the statement said.