WASHINGTON (JTA) — Former congressman Anthony Weiner reportedly is set to plead guilty to a charge related to the sexting scandal that played a major role in last year’s presidential election.

The New York Times reported that Weiner will appear in a federal courtroom on Friday and plead guilty to ”transferring obscene material to a minor.”

The plea deal with prosecutors will settle the charges against him, the Times reported. He could face a prison term of up to 10 years or may not spend any time in jail, it said.

Weiner, a New York Democrat, resigned from Congress in 2011 after he was caught lying to the media about his propensity to send sexting messages over Twitter. He said he ended the habit, but it resurfaced in 2013, leading him to pull out of the race for New York mayor that year.

He retreated into private life, raising his son with his wife, Huma Abedin, a close adviser to Hillary Clinton, the 2016 Democratic presidential nominee.

Last summer, a British tabloid reported that he was still sexting, and that one of his interlocutors was a 15-year-old girl. Federal investigators opened an investigation.

On Oct. 28, a week and a half before the election, the FBI told Congress that it was reopening an inquiry into Clinton’s use of a private email server while she was secretary of state because investigators found her emails on Weiner’s laptop, which had been seized in the sexting case. Within days, the FBI said nothing incriminating was found in the emails.

Clinton believes the hit her campaign took from the revelation led her to lose the election to Donald Trump.

Weiner and Abedin are estranged.

Weiner, who is Jewish, was outspoken in his support for Israel when he was in Congress.