Comedian Sarah Silverman says she's "insanely lucky to be alive" after undergoing surgery and spending a week in the intensive care unit due to what she calls "a freak case of epiglottitis."

"Don't even know why I went to the doctor, it was just a sore throat," she wrote on Facebook on Wednesday, "But I had a freak case of epiglottitis."

Epiglottitis is a swelling of the cartilage lid that covers the windpipe. The condition can block the flow of air into lungs and is potentially life threatening.

She wrote in the Facebook post that she underwent surgery at Cedars-Sinai Medical Center and couldn't be put to sleep for the recovery process due to low blood pressure.

She adds that she had to have her hands restrained to keep her from pulling out her breathing tube. She didn't say when the surgery took place.

"I was drugged just enough to not feel the pain and have no idea what was happening or where I was. They had to have my hands restrained to keep me from pulling out my breathing tube," she wrote. "My friend Stephanie said I kept writing 'was I in an accident?' When I woke up 5 days later I didn't remember anything."

She says she owes her life to the hospital's staff.

"When I woke up 5 days later I didn't remember anything. I thanked everyone at the ICU for my life, went home, and then slowly as the opiates faded away, remembered the trauma of the surgery & spent the first two days home kind of free-falling from the meds / lack of meds and the paralyzing realization that nothing matters."

The Associated Press contributed to this report.