In the year before his arrest on new sex trafficking charges and death by apparent suicide in a Manhattan jail cell, Jeffrey Epstein acknowledged he had become a pariah in polite society.

But the financier also told writer James B. Stewart that he continued to privately entertain friends, including Woody Allen, at dinner parties in his palatial townhouse. He would give some friends money and financial advice or listen to others’ unburden their secrets.

“His very notoriety, he said, was what made so many people willing to confide in him,” Stewart wrote in a column published Monday in the New York Times.

Stewart wrote how he visited Epstein in that townhouse Aug. 16, 2018, initially to interview him about whether he was giving business advice to Tesla CEO Elon Musk. (In a statement given to this news organization, a spokesperson for Musk and Tesla said that “it is incorrect to say that Epstein ever advised Elon on anything.”)

During the interview, Epstein also showed photos of himself with Allen and former President Bill Clinton.

“Displaying photos of celebrities who had been caught up in sex scandals of their own struck me as odd,” Stewart wrote.

Epstein also showed Stewart a full-length photo of Mohammed bin Salman, the controversial crown prince of Saudi Arabia accused by U.S. intelligence agencies of ordering the murder of Washington Post journalist Jamal Khashoggi. Epstein boasted that “M.B.S,” as he called him, had visited his home “many times” and that they “spoke often.”

According to Stewart, Epstein understood that his name had become “radioactive” since serving 13 months in a Palm Beach, Florida, county jail after being investigated on sex trafficking charges and pleading guilty to solicitation of a minor. He returned to New York City in 2010 as a registered sex offender.

But his criminal history was useful in getting certain kinds of people wanting to seek his company, Epstein explained, according to Stewart.

“Everyone, he suggested, has secrets and, he added, compared with his own, they seemed innocuous,” Stewart wrote. “People could confide in Epstein without feeling awkward or embarrassed, he claimed.”

Stewart said it’s hard to know how much Epstein exaggerated his social or business connections to certain famous people. With his death Saturday, it also is likely no one will ever known what he discussed with these people, including with Allen.

It is conceivable, though, that the 83-year-old Allen would have found in Epstein a sympathetic listener to any concerns about career troubles and public shaming in the wake of the #MeToo movement.

Resurfaced allegations that Allen molested daughter Dylan Farrow in the early 1990s and controversial comments the writer-director made about Harvey Weinstein led to a number of Hollywood stars saying they would never work with him again, the Hollywood Reporter said. Allen was never criminally charged and denied molesting his daughter.

Amazon also terminated a lucrative four-movie deal with the prolific filmmaker and shelved last fall’s scheduled release of his comedy, “A Rainy Day in New York.” The film centers on a romance between characters played by Jude Law, 46, and Elle Fanning, who was 19 during production. Variety reported that the film will finally be released in Hong Kong on Oct. 3.

Allen said in an interview in June 2018 that he supported the #MeToo movement and seeing sexual harassers and abusers brought to justice. But he also said in the interview with the Argentinian news program “Periodismo Para Todos” that his reputation had been unfairly linked to alleged serial abusers like Weinstein, when he was never charged in the one case in which he was accused.

Meanwhile, Epstein was “unapologetic” about the actions that led to his downfall, Stewart said. Epstein told him he thought that criminalizing sex with teenage girls was a cultural aberration and that at times in history had been perfectly acceptable.

About a week after Stewart met with Epstein, he said the financier called him and asked if he wanted to come to dinner with Allen.

The Daily Beast reported that Allen attended dinner at Epstein’s mansion on at least one other notable occasion. Nearly a year after his release from jail, Epstein hosted a dinner party for his longtime friend Prince Andrew in 2010. Allen was among the media elite who attended the dinner. The others present were TV anchors Katie Couric and George Stephanopoulos and comedian Chelsea Handler, the Daily Beast said.

Stewart declined Epstein’s dinner invitation, saying he had plans for that evening. Epstein later invited him to dinner with author Michael Wolff and President Donald Trump’s former adviser Steve Bannon.

But Stewart again declined, and wrote he had no idea if those dinners ever took place. He said Bannon told him he didn’t attend the dinner, while Wolff and a spokeswoman for Allen did not respond to requests for comment.