A man accused of ramming his car into a crowd of counter-protesters at a white nationalist rally in Virginia has been denied bail after the public defender’s office said it could not represent him and the judge was forced to find a local lawyer to fill in.

James Alex Fields Jr, 20, appeared in court via video link dressed in a black-and-white striped uniform. He has been charged with offences including second-degree murder.

He answered questions from the judge with simple responses of “Yes, sir” when asked if he understood what he was being told.

Fields replied “No, sir” when asked if he had ties to the community of Charlottesville.

Judge Robert Downer set an August 25 hearing for the 20-year-old.

Judge Downer said the public defender’s office informed him it could not represent Fields because a relative of someone in the office was injured in Saturday’s protest. He appointed local lawyer Charles Weber to represent him.

Fields is charged over the death of Heather Heyer, 32, of Charlottesville, who died after a car that police said Fields was driving slammed into a crowd of people protesting against the nationalist rally in Charlottesville on Saturday.

James Alex Fields Jr., second from left, holds a black shield in Charlottesville, Virginia(Alan Goffinski/AP)

Fields was arrested shortly afterwards and taken into custody.

Police allege Fields drove his silver Dodge Challenger through a crowd of protesters in Charlottesville, killing Ms Heyer and wounding 19 other people.

A Virginia State Police helicopter deployed in a large-scale police response to the violence then crashed into the woods outside of town and both troopers on board died.

Fields had been photographed hours earlier with a shield bearing the emblem of Vanguard America, one of the hate groups that took part in the “take America back” campaign to protest against the removal of a Confederate statue.

The group has denied any association with the suspect.