Sean Hayes had to postpone his Ellen DeGeneres Show interview several weeks ago -- for a very good reason.

During his appearance on Wednesday's episode, the Will & Grace star revealed his recent health scare.

"I went to bed at night and all of the sudden, I felt this excruciating pain in my stomach, so I went to the ER, and thank God I did that," Hayes recalled. "I had a very rare thing, where my small intestine burst open and it was poisoning my body."

"And so it burst open, so they went in there, and they clipped off the back part and put it back together, with, like, a chip clip, you know -- so now my potato chips are stale," he joked. "And they put you on so many drugs, you're, like, high out of your mind."

"Anyway, I was talking to your producer from the hospital. She was so nice and we were going through all the stuff, and she said, 'Are you sure you can do the show on Monday?' and I was like, 'Yeah. Can you do the show on Monday?'" he continued. "And then Scotty, my husband, is in the room with me... He goes, 'You can't do the Ellen show on Monday. Are you high?' And I go, 'Yeah, I'm really high.'"

Hayes, who also showed a hilarious photo of himself walking around the hospital with his butt hanging out of his gown, then challenged DeGeneres to a test, to see who can perform the hospital's breathing exercises best.

"Let's play the game and whoever can suck their balls the hardest wins," he instructed DeGeneres.