CHARLOTTESVILLE, Va. - Nearly two years after James A. Fields Jr. rammed his car into a crowd of counterprotesters at a white-supremacist rally in Charlottesville, the avowed neo-Nazi and convicted murderer apologized in court Friday as a federal judge sentenced him to life in prison for 29 federal hate crimes.

"Every day I think about how things could have gone differently, and how I regret my actions," he said in a packed courtroom here. "I am sorry."

Fields, 22, whose vehicular attack killed one woman and injured 35 other people, pleaded guilty to the 29 counts in April in a deal with prosecutors, who agreed to drop an additional charge that carries a possible death sentence. In a separate case stemming from the deadly incident, Fields was convicted of first-degree murder and other crimes in December by a Virginia jury that voted for a life term plus 419 years in state prison.

His sentence in the state case is due to be imposed July 15, meaning Friday's sentencing in U.S. District Court in Charlottesville was the first for Fields, an Ohio native with a years-long history of espousing racist and anti-Semitic views.

At the "Unite the Right" rally on Aug. 12, 2017, crowds of white supremacists chanting angry slogans clashed violently with counterprotesters for hours. Photos and video of the mayhem, including images of broken bodies propelled in the air by Fields's speeding Dodge Challenger, were viewed worldwide, galvanizing public attention on emboldened ethno-fascists in the early months of the Trump administration.

"I would like to apologize for the hurt and loss I have caused," Fields said in court, adding, "I apologize to my mother for putting her through all this."

In an hours-long sentencing hearing, Judge Michael Urbanski rejected a request for leniency from defense lawyers and imposed the life term sought by federal prosecutors.

Fields, whose psychiatric disorders dating from early childhood were detailed in court during his state trial, did not deny he intentionally rammed his car into a group of counterprotesters, killing Heather Heyer, 32, a local law firm employee.

In a sentencing memo filed in court by the U.S. attorney's office in Charlottesville, prosecutor Christopher Kavanaugh called the attack "domestic terrorism."

"The defendant's crimes were so horrendous, and the maiming of innocents so severe, that they outweigh any factors" that Fields might cite in seeking leniency, Kavanaugh wrote. "This is particularly true in light of the fact that he has demonstrated that he feels no remorse for his actions and continues to espouse his hateful ideology."

The 50-page document quotes a recorded phone call by Fields from the Albemarle Regional Jail in Charlottesville on Dec. 7, 2017, almost four months after the rally, in which he refers to Susan Bro, Heyer's mother. Bro has been outspoken since her daughter's death, calling for healing and reconciliation in the community.

"She is a communist," the memo quotes Fields as saying on the phone with his mother. "An anti-white, liberal. . . . It's not up for questioning. She's the enemy."

"Nobody is the enemy," his mother replied.

"She is the enemy," Fields insisted before cursing at his mother to stop questioning him.

In the filing, Kavanaugh detailed Fields's professed admiration for the militarism and racial purity doctrine of Nazi Germany - a fascination that has been well documented over the past two years in court testimony and media reports. The memo offers new details, though, including about Fields's trip to Germany with high school classmates.

"When the group visited the Dachau concentration camp, the defendant said, 'This is where the magic happened,' and then skipped happily down the train tracks that transported Jewish prisoners to the camp," Kavanaugh wrote about a classmate's recollection.

"When they visited the gas chambers . . . the defendant stated, 'It's almost like you can still hear them screaming,' " the memo says. Quoting a classmate who went on the trip, Kavanaugh said Fields was "elated and happy" when he made the statement.

At Fields' state trial, a psychologist who reviewed thousands of pages of his school and mental-health records testified that Fields was found to be suffering from bipolar disorder and schizoid personality disorder as a child. He was housed in psychiatric facilities for three stretches before his 15th birthday, according to testimony.

He was prone to angry, sometimes violent outbursts since before he could walk, and he was expelled from preschool because of his volatile behavior, the psychologist said.

In a sentencing memo asking for a prison term of less than life, Fields's lawyers cited an array of traumas and other trouble in his childhood. "Fundamentally, James's mental illness causes him to lose emotional and behavioral control in stressful situations," they wrote.

Before the Unite the Right rally, "he had never attended a political event of any kind, or really any event involving a large crowd," the defense memo says, adding that in the hours leading up to the car attack, Fields was anxious, sleep-deprived and dehydrated.

"James did not come to Charlottesville with any plan to commit an act of violence," they wrote. "In the space of only a few minutes, caught in circumstances he did not intend to create, he acted in an aggressive and impulsive manner consistent with his mental health history and his age."

They added: "In a matter of seconds he caused irreparable harm for which there is no excuse. But this Court can understand his actions, without excusing them, as symptomatic of transient immaturity, and not consider them to be predictive of who he might be in the future with time and medication."

This article was written by Joe Heim and Paul Duggan, reporters for The Washington Post.