What Felicity Huffman now calls the worst decision of her life came to a head at 6 a.m. March 12, when six federal agents showed up at the door of her Hollywood Hills home, guns drawn, to march the actress, in handcuffs, out of the realm of the beloved and into the realm of the scorned.

Letters that Huffman and her husband, William H. Macy, wrote to the judge who will sentence her this week offer the most detailed explanation to date about how the couple got involved in the scandal and how they are grappling with Huffman’s extraordinary fall from grace.

Both award-winning actors said they were trying to be good parents. Huffman expressed deep regrets for her actions, adding she has disgraced herself and betrayed her daughter.

Perhaps because of her acting fame, perhaps because she had dispensed folksy advice on motherhood from her blog, Huffman became a face of an admissions scandal that burst into view six months ago, when federal prosecutors in Massachusetts alleged wealthy parents had for years paid staggering sums to fix their children’s college entrance exams and slip them into elite universities as phony athletes.

Yet, until Friday, Huffman had said little about why she paid a college admissions consultant $15,000 to rig her daughter’s SAT score, leaving the public to wonder: Why would a mother who could offer her children everything resort to fraud to get them ahead?

In her letter, Huffman said she had panicked, having come to believe her daughter’s low math scores on the SAT would hamstring her dreams of becoming an actress.

“In my desperation to be a good mother,” she wrote, “I talked myself into believing that all I was doing was giving my daughter a fair shot. I see the irony in that statement now because what I have done is the opposite of fair.”

Prosecutors on Friday filed a blistering memo of their own, saying crimes committed by Huffman and her co-defendants should not be interpreted as runaway parental zeal.

“All parents want to help their kids get ahead,” they wrote in asking a judge to commit Huffman to prison, “yet most manage to steer clear of conspiracy, bribery and fraud.”

Huffman’s letter describes how she came to meet William “Rick” Singer, a college admissions consultant to the wealthy and the mastermind of the fraud exposed by prosecutors this year. Singer pleaded guilty in March to four felonies, acknowledging he rigged SAT and ACT exams for his clients and misrepresented their children as promising recruits for sports they didn’t actually play.

But when Huffman went searching for a college counselor in 2016, concerned that her daughter’s public high school had just one overworked counselor for 300 students, Singer was recommended by a friend “as one of the best experts in L.A.,” she wrote. “I was told I would be lucky if I could get him to sign on to help me.”

Huffman said she didn’t “go shopping” for a fixer to rig her daughter’s SAT and didn’t even know it could be done.

Singer tutored her daughter legitimately, helping her with the math section of the SAT, Huffman said, and she was “relieved that he seemed so good at his job, was so confident and knowledgeable.”

But after a year of tutoring, Singer told Huffman they weren’t making much progress. “We still had a serious problem and, according to him, he had the solution,” she said.

As described by prosecutors, Singer explained to Huffman and Macy that he could pay a test proctor to allow an accomplice, Harvard-educated Mark Riddell, to correct their daughter’s answers on the SAT.

“We will make sure she gets the score she needs,” he told Huffman, according to her letter.

Riddell has pleaded guilty to conspiracy to commit fraud and money laundering. When she pleaded guilty to fraud conspiracy in May, Huffman said she did not dispute the prosecution’s account of her dealings with Singer.

Macy hasn’t been charged with a crime. Although they don’t identify him by name, charging documents filed by prosecutors show Macy discussed and assented to the cheating.

On a Saturday morning in December 2017, Huffman’s daughter took the SAT at a private school in West Hollywood. Once she finished, Riddell corrected her answers. Both prosecutors and Huffman say the girl had no knowledge of the scheme.

Two months later, Huffman and Macy made a $15,000 “contribution” to Singer’s foundation, which has since been exposed as a conduit that allowed Singer’s clients to funnel money to him, test proctors and college coaches while taking a tax write-off.

Huffman was arrested March 12. Two days later, Macy said in his letter, their older daughter flew to an audition at a college. When she landed, she learned in an email that the college had rescinded her invitation to audition.

“She called us from the airport in hysterics,” Macy said, “begging us to, ‘Do something, please, do something.’ ”

Ironically, Macy said, the college — which he didn’t name — doesn’t require applicants to take the SAT.

He said their daughter “has nightmares from the FBI agents waking her that morning with guns drawn.”

The early-morning arrests of Huffman and 32 other parents in Manhattan, the Westside of Los Angeles and other wealthy enclaves across the country raised eyebrows from some legal observers, who noted prosecutors often let those charged with similar nonviolent offenses to negotiate a surrender.

But from the day the case was unsealed, prosecutors have emphasized that they intend to treat Singer’s moneyed clients no different from any other accused felons. They cited that reasoning again Friday in arguing why Huffman and 10 other parents should be imprisoned for conspiring with Singer.

“Incarceration is the only leveler,” they said. “In prison everyone is treated the same, dressed the same, and intermingled regardless of affluence, position or fame.”

Prosecutors have asked that Huffman receive a one-month prison sentence when she appears before U.S. District Judge Indira Talwani on Sept. 13 as the first parent to be sentenced in the scandal.

Huffman’s attorneys say probation, a $20,000 fine and 250 hours of community service would suffice.

Since her arrest, Macy said in his letter, Huffman has hardly left their home because the paparazzi “have an uncanny knack of finding her.” She’s received no job offers or auditions, he said, and it’s unclear “when or how Felicity will resume her acting career.”

Their older daughter has decided to take a gap year but plans to apply to college again, Macy said. Their younger daughter is in her last year of high school.

“She hurt her daughters,” Macy said. “It was the one thing she swore never to do, and she did it. It’s a great lump of pain she carries with her every night and day.”