Huma Abedin is begging a federal court to grant leniency to her estranged husband Anthony Weiner as he faces prison time for sending sexual materials to a 15-year-old girl, saying a light sentence would be in the best interests of the couple's young son.

Weiner, who pleaded guilty in May to federal obscenity charges related to his online sexual relationship with the teenager, is scheduled to be sentenced later this month. He faces a maximum of 10 years in prison, but prosecutors have requested between 21 and 27 months.

Abedin, who filed for divorce last May, is now asking the court to go easy on Weiner in order to reduce the impact on their five-year-old son, Joshua.

His name was removed from court documents made public Thursday, and large portions were redacted.

Weiner's parents and brother also wrote to the judge, as did members of his recovery program for sex addiction.

Scroll for video

Abedin is fighting for full custody of her son. Pictured: The parents walked their son Jordan to school on the first day of the school season on Friday

Admitted sex offender Anthony Weiner and his estranged wife Huma Abedin appeared before Judge Michael Katz at The Supreme Court of New York for a hearing over their divorce on Wednesday. Now her letter the a federal judge who will sentence him for his sex crime is revealed

Abedin remained mostly expressionless in court. The divorce case is contested, as Abedin is seeking full custody of their 5-year-old son

The girl who exchanges sexts with Weiner revealed her face on Friday. She is not being named because she is still a minor but her father gave permission for her face to be shown

Huma's plea: Hillary Clinton's top aide reveals her asking for the judge not to have 'negative impact' on their son when he sentences her pervert ex-husband

'I am writing regarding the sentencing for Anthony Weiner, my husband, from whom I have filed for divorce,' wrote Abedin in a letter to U.S. District Court Judge Denise L. Cote.

'I hope the Court will take [our son] into consideration as it weighs all it has to in considering Anthony's sentence,' she added. 'As would any parent, if there has to be a negative impact on [our son], I would like it to be as small as possible.'

Abedin said that despite Weiner's faults – including his repeated 'sexting' relationships that destroyed his political career and reputation – her estranged husband has always been a devoted father to their son.

'Anthony and I have a wonderful son, [Jordan], who is [five] years old and is the light of our life. It is for [our son] that I write this letter,' she wrote.

'Whatever else Anthony has done, he loves [our son].'

Abedin, a long-time aide to Hillary Clinton, acknowledged in the letter that she was devastated by Weiner's actions and believes he should still face consequences.

'This is not a letter I ever imagined I would write, but, 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,' she wrote.

'However, as a mother, I have always done and will do anything I think will help [our son] be as safe, happy, healthy, and complete as possible.'

Weiner carried on a sexual relationship with a 15-year-old high school sophomore that started in January 2016 and lasted for several months, DailyMail.com first reported last September.

Although the girl told Weiner she was in high school, the former congressman told her in messages that she made him 'hard' and said he wanted to 'bust that tight p***y so hard and so often that you would leak and limp for a week.'

The teenager said in an interview that Weiner would also chat with her on a video messaging program, during which he asked her to dress up as a school girl and talked about his 'rape fantasies.' Weiner also sent her photos of him shirtless and posing provocatively.

The story prompted an FBI investigation into Weiner, during which investigators stumbled across previously undisclosed emails from Clinton's private email server on Weiner's laptop.

Mother's ruined: Anthony Weiner's mother Frances wrote a lengthy plea to the judge but large sections which appeared to be about his childhood were blacked out

My brother's keeper: Jason Weiner, a chef, revealed how their late brother Seth was 'a source of tumult' when they were growin gup

Abedin seemed to dominate the conversation when she sat next to the former congressman while keeping a cool expression, but Weiner could not match her poker face

Although Abedin stood by Weiner through recurrent sex scandals that destroyed his career, the final straw for their marriage was Weiner's months-long sexting relationship with a high school sophomore

The discovery led FBI director James Comey to reopen his investigation into Clinton's emails just days before the presidential election. Clinton has blamed this decision in part for her election loss.

Abedin, who worked with Clinton for two decades and was a senior campaign aide, was said to be devastated after hearing the news.

She told Clinton: 'This man is going to be the death of me' and burst into tears, according to Clinton's account in her new book What Happened.

Weiner's relationship with the teenager followed numerous sexting scandals that cost the former congressman his political career, his marriage, and now potentially his freedom.

Abedin and Weiner married in a lavish wedding ceremony officiated by Bill Clinton in 2010, after three years of dating.

But their marital bliss didn't last long. In 2011, Weiner was forced to resign his seat in congress after it was revealed that he had been sending sexual messages and photos to numerous women, including a college student and a Las Vegas blackjack dealer.

Weiner attempted to mount a comeback in 2013 with a run for mayor in New York City. Although he was initially a frontrunner to win the Democratic primary, he lost public support after news broke that he had been carrying on another sexting relationship with 23-year-old Sydney Leathers.

During that scandal, it was also revealed that Weiner used the moniker 'Carlos Danger' during his online trysts with other women.

The divorce judge acknowledged they wanted to resolve their divorce amicably and added he hoped to help them work something out that would work for their family

Abedin seemed to be able to keep her emotions in check and was composed during the hearing while Weiner walked into the room visibly upset

Although they arrived separately, the two walked into the Manhattan courtroom together and then hurriedly left the building after 30 minutes, having a black car whisk them away.

Abedin finally announced that she was separating from Weiner last summer, after a woman came forward to say Weiner had sent her a provocative photo of his crotch while he was lying in bed with his young son.

The picture prompted New York child protective services to launch an investigation into Weiner, who was a full-time dad while Abedin followed Clinton on the presidential campaign trail.

One month later, DailyMail.com reported on Weiner's explicit messages to the 15-year-old girl.

The former congressman pleaded guilty on May 19 to sending obscene material to the teenager.

Weiner has also asked the judge for leniency in a letter, saying he has gone to rehab, is in recovery and deeply regrets how his actions hurt the 15-year-old girl and his own family.

As part of his deal with the feds, Weiner's attorneys said they would not appeal any prison sentence below the prosecution's request of 21 to 27 months.

Abedin filed for divorce the same day her husband pleaded guilty, and the couple attended an initial hearing on Wednesday to ask the court to keep the details of their divorce private. Abedin is requesting full custody of the couple's son.

The estranged couple arrived at the divorce hearing separately but left together in the same car. They appeared to be on friendly terms while laughing and talking together in the courtroom.

Abedin stood by Weiner through recurrent sex scandals that destroyed his career but the final straw for their marriage was Weiner's months-long sexting relationship with a high school sophomore.

DailyMail.com's revelation prompted an FBI investigation into Weiner.

In the course of that investigators stumbled across previously undisclosed emails from Clinton's private email server on Weiner's laptop.

The discovery led FBI director James Comey to reopen his investigation into Clinton's emails just days before the presidential election – a move Clinton has blamed in part for her election loss.

Abedin, who worked with Clinton for two decades and was a senior campaign aide, was said to be devastated after hearing the news.

'When we heard this, Huma looked stricken,' wrote Clinton in her new book What Happened. 'Anthony had already caused so much heartache. And now this.'

Abedin told Clinton: 'This man is going to be the death of me,' before bursting into tears.

The couple met in 2001 when Weiner was a first-term congressman and Abedin was an aide to then-Senator Hillary Clinton. They were married at the Oheka Castle in New York in 2010

At one point, Abedin cracked a smile along with Weiner while their attorneys were in another room talking with the judge

Clinton said her long-time aide's anguish 'broke my heart' and made her determined to stand by Abedin despite the damage to her campaign.

The devastating revelation was one of many Abedin endured during her seven-year marriage to Weiner.

The couple first met in 2001 when Weiner was a first-term congressman and Abedin was an aide to then-Senator Hillary Clinton. Abedin was 25 at the time and already a seasoned Clinton insider, having worked for the former First Lady from the time she was 19.

Weiner has admitted he was interested in Abedin immediately, but said he didn't ask her out to drinks until they bumped into each other that summer in Martha's Vineyard. The date didn't go well; Abedin ordered a cup of tea and quickly 'ditched' Weiner, according to his account.

But they reconnected romantically in 2007, after Abedin sent Weiner a flirty text message during the State of the Union to thank him for sitting next to Clinton at the speech.

'I appreciate you looking out for my boss,' she wrote.

Although Abedin stood by Weiner through recurrent sex scandals that destroyed his career, the final straw for their marriage was Weiner's months-long sexting relationship with a high school sophomore. Pictured: Weiner's texts to the young girl

Another of the inappropriate images Weiner sent showed him curled up with his then four-year-old son

At the time, Weiner was a rising star among House Democrats due to his combative style and regular appearances on cable news shows.

Abedin, meanwhile, was one of the closest confidantes to the woman who was expected to win the Democratic presidential nomination the following year.

Weiner and Abedin quickly cemented themselves as a political power couple and were engaged by 2009.

They married in 2010 in a lavish celebration at Oheka Castle on Long Island – a venue that runs $100,000 for the average wedding – with Abedin wearing a custom Oscar de la Renta gown and Bill Clinton officiating the ceremony.

But just one year later the couple's idyllic image would be shattered, when Weiner accidentally posted a photo of his underwear-clad crotch on Twitter while attempting to send it privately to a female college student.

The congressman deleted the photo and initially claimed his account was hacked.

But he eventually admitted that he had been sexting with numerous women, after several came forward to say they had exchanged explicit messages and photos with him.

In the midst of the controversy, Weiner resigned from Congress and said he was going to therapy to deal with sexual addictions.

Two years later, Weiner launched a political comeback with his campaign for New York City mayor. New Yorkers seemed poised to forgive his past transgressions, and the former congressman led in Democratic polls.

But shortly before the primary election, news emerged that he had continued to send explicit text messages and photos to 23-year-old Sydney Leathers – causing Weiner's poll numbers to plummet and costing him the nomination.

In the 2016 documentary Weiner, which followed the former congressman throughout the mayoral campaign, Abedin looks alternately disgusted and distraught as news of her husband's affair went public.

'It's like living a nightmare,' she told the camera at one point.

Abedin finally announced that she was separating from Weiner last summer, after it was revealed that the former congressman sent another woman a lewd photo of his crotch while he was in bed with his 5-year-old son.

A few weeks later, DailyMail.com reported on Weiner's sexting relationship with a 15-year-old girl. Although the girl told Weiner she was in high school, the former congressman told her in messages that she made him 'hard' and said he wanted to 'bust that tight p***y so hard and so often that you would leak and limp for a week.'

The teenager said in an interview that Weiner would also chat with her on a video messaging program, during which he asked her to dress up as a school girl and talked about his 'rape fantasies.'

During the relationship, which started in January 2016 and carried on for several months, Weiner also sent her photos of him shirtless and posing provocatively.

There were reports that Abedin and Weiner were working to repair their relationship as recently as last spring. But that possibility was dashed on May 19, when Weiner appeared in a New York court to face federal charges

Investigators looked at Huma's laptop as part of their probe into her husband's affair. It crossed over into a separate FBI investigation into Hillary Clinton's use of a private email server

The girl, who showed her face publicly for the first time last week, said she initially decided to come forward about Weiner because she was disturbed he had sent women photographs of him posing with his young son.

After the scandal broke, Weiner spent several weeks at a rehab center for sex addiction in Tennessee.

Although Abedin and Weiner were technically separated last summer, they continued to live together in their $3.3million Manhattan apartment.

There were reports that Abedin and Weiner were working to repair their relationship as recently as last spring. But that possibility was dashed on May 19, when Weiner appeared in a New York court to face federal charges.

Weiner pleaded guilty to sending obscene material to a minor, a charge that could land him in prison for up to 10 years when he is sentenced later this month.

He broke down in tears and apologized during the hearing, telling the judge that he has a sickness.

'I have a sickness but I do not have an excuse,' he told the court.

Although Weiner could face up to a decade in prison, his plea agreement makes it likely he will be sentenced to far less than that. Prosecutors have asked for him to be sentenced to 21 to 27 months, and Weiner's legal team agreed not to appeal any sentence below that range.

Abedin filed for divorce hours after the hearing.