The Ohio man convicted for a deadly car attack at an August 2017 white nationalist rally in Charlottesville, Va., pleaded guilty to federal hate crime charges on Wednesday.

James Alex Fields Jr., 21, admitted to one count of a hate crime act resulting in the death of 32-year-old Heather Heyer, and another 28 counts of hate crime acts causing bodily injury. Prosecutors said Fields admitted that he drove his car into a crowd of counterprotesters at a "Unite The Right" rally on Aug. 12, 2017, "because of the actual and perceived race, color, national origin and religion of its members."

Fields formally entered his plea at a hearing in U.S. District Court in Charlottesville. He did not speak, except to repeatedly respond, "Yes, sir," when Judge Michael Urbanski asked him if he was pleading guilty knowingly and voluntarily.

Fields, who was convicted in December of first-degree murder and other state charges, is scheduled to be sentenced on the hate crime charges on July 3. He faces life in prison.

"The violence in Charlottesville was an act of hate, and everyone across the country felt the impact," FBI Director Christopher Wray said in a statement. "This guilty plea underscores that we won’t stand for hate and violence in our communities."

Attorney General Bill Barr referenced the March 15 shooting at two mosques in Christchurch, New Zealand, in his statement.

"In the aftermath of the mass murder in New Zealand earlier this month, we are reminded that a diverse and pluralistic community such as ours can have zero tolerance for violence on the basis of race, religion or association with people of other races and religions," Barr said. "Prosecuting hate crimes is a priority for me as attorney general. ... These hate crimes are also acts of domestic terrorism."

The "Unite the Right" rally drew hundreds of white nationalists to Charlottesville to protest the planned removal of a statue of Confederate Gen. Robert E. Lee. Hundreds more turned out to protest against the white nationalists.

NEW ZEALAND MOSQUE SHOOTING SUSPECT SENT DONATION TO AUSTRIAN FAR-RIGHT LEADER, SPARKING ANTI-TERROR PROBE

President Trump stirred up a national furor when he attributed the violence at the rally to people "both sides," a statement critics saw as a refusal to condemn racism.

The car attack by Fields came after violent brawling between the two sides prompted police to disband the crowds.

During his state trial, prosecutors said Fields -- he described himself on social media as an admirer of Hitler -- drove his car directly into a crowd of counterprotesters because he was angry after witnessing earlier clashes between the two groups.

CLICK HERE TO GET THE FOX NEWS APP

The jury rejected a claim by Fields' lawyers that he'd acted in self-defense because he feared for his life after witnessing the earlier violence.

Jurors in Fields' state trial recommended a life sentence plus 419 years, although a judge still has to decide on the punishment. Sentencing in that case is scheduled for July 15.

The Associated Press contributed to this report.