Joan Rivers died as a result of complications of low blood oxygen during a medical procedure she underwent at a Manhattan clinic, the New York City Office of Chief Medical Examiner said Thursday.

The comedian suffered brain damage due to lack of oxygen during an exam, a “predictable complication of medical therapy,” medical examiner’s office said.

Rivers, 81, was undergoing a laryngoscopy and an upper gastrointestinal endoscopy when she went into hypoxic arrest, which occurs when the brain lacks oxygen. She was rushed to a hospital where she died on September 4 after being removed from life support.