Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

Disgraced former New York congressman Anthony Weiner is no predator and should be spared from prison at his sentencing for sexting with a 15-year-old North Carolina girl who dreamed about affecting the U.S. presidential election, his lawyers told a judge on Wednesday.

The submission in Manhattan federal court referenced "Anthony's operatic self-destruction," describing the crime as "the final act ... born of deep sickness." But it blamed the girl, saying she has told government investigators it had been a goal of hers to affect last year's election.

The court filing included letters from Weiner and his estranged wife, Hillary Clinton aide Huma Abedin, who appeared with him in state court earlier in the day at a divorce proceeding.

Anthony Weiner and Huma Abedin appear in court in New York on Sept. 13 in a divorce proceeding. Jefferson Siegel / The Daily News via AP

In a heavily blacked-out letter, Abedin wrote: "With Anthony, I have repeatedly found myself in circumstances I never imagined. I am devastated by Anthony's actions, and I understand he must face their consequences."

Related: Anthony Weiner Pleads Guilty in Teen Sexting Case

The lawyers described Weiner, a once powerful Democrat, as having committed a crime, though "one far less egregious than any sexting case that has been prosecuted in this district."

They said he never sought out teenagers on the internet and didn't engage in other predatory behaviors typical of those arrested in similar cases.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

"He responded to the victim's request for sexually explicit messages not because she was a teenager but in spite of it," the lawyers said.

The lawyers said Weiner had caught the eye of "a curious high school student, looking to generate material for a book the government has disclosed she is now shopping to publishers." They said the girl documented their interactions from the outset, photographing her phone to preserve messages, before selling her story to a British tabloid for $30,000.

The lawyers said the investigation of Weiner was "quite improperly injected into the U.S. presidential election, quite possibly affecting its outcome."

"After the election was over, the high school student told government investigators that this had been one of her goals from the outset," Weiner's lawyers wrote.

The girl told Inside Edition in an interview she knew that Clinton, a Democratic former U.S. secretary of state, senator and first lady, would be running for president last year.

"I wanted to see if Anthony was still up to the same antics," she said.

In a letter to U.S. District Judge Denise Cote, who will sentence Weiner on Sept. 25, Weiner wrote that "regret for my crime is profound" and that he had endangered the well-being of a 15-year-old girl.

"My continued acting out over years crushed the aspirations of my wife and ruined our marriage," he said.

Hours earlier, Weiner and Abedin appeared briefly before a judge in their divorce case. They sat side by side and chatted casually while their lawyers met with state Supreme Court Justice Michael L. Katz.

An FBI investigation into Weiner's online relationship with the girl became a factor in the presidential election. Then-FBI Director James Comey announced in late October 2016 that an investigation into emails that had been kept on Clinton's private server needed to be reopened while the bureau looked at emails found during the Weiner probe.

Although Comey announced two days before the November election that nothing was found in the new search that would result in charges against Clinton, she has cited it as a reason for her loss to Donald Trump.

Trump, a Republican, became president in January and dismissed Comey in May.

Weiner, who unsuccessfully ran for mayor in 2005 and 2013, is eligible for a harsh term of years in prison in the sexting case but is likely to face less time. As part of his plea bargain, he agreed not to appeal any sentence between 21 and 27 months.

In his sentencing letter, Weiner wrote that he now attends daily "mutual support meetings" as part of treatment and mentors those new to the program.

He said he was profoundly sorry to his victim.

"My life isn't big and loud anymore," he said. "Every day I quietly do what I can to keep getting better and to fix the damage I've done."