“American Idol” winner Phillip Phillips was in far worse condition than anyone thought before he went under the knife? TMZ reports.

The good news … we're told Phillip will be released from the hospital today after undergoing more than 6 hours of major surgery for massive kidney stones.

It turns out … the stent that was placed in Phillip's kidney was there way too long? — so long, it became embedded in his body.? It became so bad, surgeons had to cut the stent out with a laser.

Doctors say the surgery was successful, so Phillip will be recovering in a Malibu mansion thanks to one of the “American Idol” honchos who is letting the “A.I.” winner use his pad.

Phillip is hoping to be fully recovered by July 6th … which is when the Idol tour officially kicks off in Detroit.??

Phillip says, “If I can sing with all those kidney stones in me, I can make the first date.”