Jeffrey Epstein is dead, but mystery surrounding his suicide, and how hs sexual assault allegations will be resolved, still remain.

Jeffrey Epstein was confident he could fight the child sex trafficking charges against him and was in “great spirits” just hours before his jailhouse death on Saturday morning — even telling one of his lawyers, “I’ll see you Sunday,”The New York Post has learned.

The convicted paedophile also told his lawyers that the neck injuries he suffered in an earlier incident at the Metropolitan Correctional Center were inflicted by his hulking, ex-cop cellmate, which led the lawyers to request that he be taken off a suicide watch, according to a source familiar with Epstein’s case.

Epstein’s optimism behind bars — expressed during daily visits with his lawyers that lasted up to 12 hours each — was so great that it struck some of those around him as “delusional,” the source said.

“He thought he was going to win the double-jeopardy motion” that his defence lawyers were planning to file in connection with his 2008 Florida prostitution conviction, the source said.

The multi-millionaire — who was jailed in Lower Manhattan on orders from a judge who cited his “uncontrollable” sexual urges — also “had hope of getting bail on appeal,” the source said, through an application that was pending before the US Second Circuit Court of Appeals at the time of his death.

“What he really wanted to do was get bail so he could co-operate,” the source said.

But whatever evidence Epstein may have had against his rich and powerful former friends died with him, because he kept no diary or notes that documented any alleged wrongdoing, the source said.

“He was delusional,” the source said.

“He thought he was going to get the same deal he got in Florida.”

Epstein, 66, pleaded guilty to two state charges of solicitation of prostitution — one involving a minor — as part of a sweetheart deal in which then-Miami US Attorney Alex Acosta approved a non-prosecution agreement over allegations the financier sexually abused dozens of underage girls at his waterfront mansion in Palm Beach.

Acosta was forced to resign as US labour secretary last month over controversy sparked by Epstein’s July 6 arrest on a child sex trafficking indictment obtained by Manhattan US Attorney Geoffrey Berman, who has said he’s not bound by the non-prosecution agreement in Florida.

The Manhattan federal court indictment accused Epstein of abusing dozens of underage girls between 2002 and 2005 at locations including his Upper East Side townhouse and Palm Beach mansion.

Epstein’s properties also included a private island, Little St. James, in the US Virgin Islands, and the “Zorro Ranch” in Stanley, New Mexico, that includes a sprawling mansion, landing strip and aeroplane hangar.

While locked up at the MCC, Epstein’s mood rarely wavered during the seven-days-a-week meetings with his lawyers, which routinely began at 8am, the source said.

“Every day he was very positive and the night before he was real positive,” the source said. “He was in great spirits the night before.”

Epstein even told a lawyer who met with him on Friday — one day before the US Bureau of Prisons has said he was found “unresponsive” in his cell — that he was looking forward to their next visit.

“He was like, ‘I’ll see you Sunday,’ ” the source said.

It’s unclear whether Epstein’s sustained sunny disposition was sincere, or part of an elaborate act designed to enable him to kill himself.

He was found unresponsive in his cell at around 6.30am on Saturday.

Paramedics tried to revive him, but he was pronounced dead a short time later at New York-Presbyterian Lower Manhattan Hospital.

Epstein’s death followed a July 23 incident in which he was found nearly unconscious on the floor of his cell and was placed on a suicide watch, law enforcement officials have said.

He was removed from the suicide watch on July 29 at the request of his defence lawyers, according to published reports.

At the time of the July 23 incident, Epstein was sharing his cell with a hulking, former Westchester County cop, Nicholas Tartaglione, who faces a death-penalty trial in four drug-related slayings upstate.

Epstein told his lawyers that “the cop roughed him up, and that’s why they got him off suicide watch,” the source familiar with Epstein’s case said.

Tartaglione’s lawyer, Bruce Barket, disputed that account, saying, “I spoke to his lawyers and they never hinted at that to me, but he must have said something to get off suicide watch.”

“I do know that Nick was not brought up on any charges at all in the institution, so they cleared him,” Barket said.

“It’s simply, patently false to say that [Epstein] did anything other than try to kill himself at least twice, and succeeded when he succeeded.”

Barket added: “We were a little worried that he would make up something to get out of suicide watch or try and argue for bail, but it’s pretty clear what happened, given the end result here.”

The US Bureau of Prisons, which runs the MCC, declined to comment, citing investigations into Epstein’s death by the FBI and the Justice Department Office of the Inspector General.

Epstein’s legal team didn’t return a request for comment.

This article originally appeared on the NY Post and is republished with permission.