The medical examiner on Thursday completed the investigation into the death of beloved comedian Joan Rivers, ruling the death resulted from a “predictable complication” of the procedure she had.

Rivers, 81, died last month after undergoing what was supposed to be a routine procedure on her vocal cords at Yorkville Endoscopy in August. She had been hospitalized at Mount Sinai Hospital in Manhattan from Aug. 28 until her death on Sept. 4.

Rivers suffered brain damage due to a lack of oxygen, said Julie Bolcer, a spokeswoman for the ME’s office, in a statement.

“The cause of Ms. Rivers' death is anoxic encephalopathy due to hypoxic arrest during laryngoscopy and upper gastrointestinal endoscopy with propofol sedation for evaluation of voice changes and gastroesophageal reflux disease,” ME Spokeswoman Julie Bolcer said in a statement. “The manner of death is therapeutic complication.”

Initially the autopsy was ruled inconclusive with more tests needed.

Many mourned Rivers’ sudden death. Her funeral, held at Temple Emanu-El on the Upper East Side, was a spectacle, attended by scores of celebrities and fans, just as she has said she wanted.

Rivers leveraged her brash style of comedy, no-holds-bar commentary and experience with plastic surgery into a very long and successful career.

Rivers was a frequent guest host on Johnny Carson's “Tonight Show” and went to host her own late-night show. In 2010, she began hosting the E! News show “Fashion Police,” earning many young fans.