An official autopsy shows that Jeffrey Epstein killed himself by hanging, authorities said Friday.

The 66-year-old pedophile died in his cell at the Metropolitan Correctional Center in lower Manhattan last week, according to findings by the city Medical Examiner’s Office.

The multimillionaire was being held on federal sex-trafficking raps that could have sent him to prison for 45 years.

The autopsy and other evidence confirmed Epstein committed suicide, the ME’s office said without elaborating.

Officials said earlier this week the autopsy had been completed but that the medical examiner needed “further information” before determining Epstein’s official cause of death.

Epstein was found with a bed sheet wrapped around his neck. It had been tied to the top of a bunk bed in his jail cell, and he was found kneeling, leaning forward, creating a lethal noose.

There were questions about why Epstein wasn’t on suicide watch.

He had been after being found in his cell in July with marks around his neck. But his lawyers had asked for him to be taken off the watch about a week later, and the MCC agreed.

That meant instead of being checked on in his cell every 15 minutes, guards would now make a pass every 30 minutes.

In Epstein’s case, even that didn’t happen.

It turned out he hadn’t been checked on for hours before his death. The two guards who were supposed to check on him during their rounds were asleep at the time, claiming they were overworked. One wasn’t even a full-fledged corrections officer.

A furious US Attorney General William Barr said he was “appalled’’ at the circumstances surrounding Epstein’s death and opened a probe.

He also reassigned the MCC warden, Lamine N’Diaye — who a well-placed source told The Post on Friday has hired a prominent criminal-defense lawyer to protect himself amid potential fallout from the debacle.

The source said N’Diaye starts a reassignment in Philadelphia next week.

The warden has no plans to sue anyone, the source said — this is strictly a defensive move.

“He needs adequate representation,’’ the source said. “He is worried about losing his position’’ as a warden.

Messages left at phone numbers listed for N’Diaye were not returned Friday.