US President Donald Trump has belatedly condemned as "repugnant" the white supremacist groups involved in the violence in the US city of Charlottesville, declaring that "racism is evil".

Trump made an unannounced national address on Monday discussing the deadly weekend incident after he was criticised by both Republicans and Democrats for not being forceful enough in condemning racism.

"Those who cause violence in its name are criminals and thugs, including the KKK, neo-Nazis, white supremacists, and other hate groups that are repugnant to everything we hold dear as Americans," he said.

"Those who spread violence in the name of bigotry strike at the very core of America."

OPINION: Charlottesville is America everywhere

He also announced that the justice department had opened a civil rights investigation into the car-ramming incident that killed one woman and wounded dozens of others.

"To anyone who acted criminally in this weekend's racist violence, you will be held fully accountable. Justice will be delivered," he said.

Trump made the statement just hours after a judge in Charlottesville, Virginia, denied bail for the man accused of ploughing his car into a crowd of counterprotesters at the Charlottesville rally.

Judge Robert Downer said during a bail hearing on Monday that he would appoint a lawyer for James Alex Fields Jr. In the meantime, he has been ordered to stay in jail.

Fields, who appeared in court through closed-circuit television, is charged with second-degree murder and other counts after authorities said he drove into the crowd, killing a woman and injuring 19 others.

The judge said the public defenders' office informed him it could not represent Fields because a relative of someone in the office was injured in Saturday's protest.

Downer said a local lawyer would be appointed to represent the 20-year-old suspect.

The next scheduled court hearing is on August 25, although Fields' lawyer could request a bond hearing before then.

Al Jazeera's Heidi Zhou-Castro, reporting from Charlottesville, said security concerns prevented the suspect from appearing in person before the court.

Wearing a black and white striped uniform, Fields answered questions from the judge with simple responses of "Yes, sir." when asked if he understood the judge.

READ MORE: Witnessing the 'monstrous' attack in Charlottesville

He told the judge, "No, sir." when asked if he had ties to the community of Charlottesville.

Fields allegedly slammed his car into the crowd of people protesting against the white nationalist rally on Saturday, killing 32-year old Heather Heyer, a resident of Charlottesville.

On Monday, Trump called Heyer's death as "tragic", while also paying tribute to two law-enforcement officers killed in an accident related to Saturday's rally.

"These three fallen American embody the goodness and decency of our nation."

Fields, the suspect in Saturday's attack, was arrested shortly after and has been in custody ever since.

Fields had been photographed carrying the emblem of Vanguard America, one of the hate groups that organised the "Take America back" campaign in protest at the removal of a statue of a general who supported slavery in the US.

The group on Sunday denied any association with the suspect, even as a separate hate group that organised Saturday's rally pledged on social media to organise future events that would be "bigger than Charlottesville".

Fields was fascinated with Nazism, idolised Adolf Hitler, and had been singled out by school officials in the 9th grade for his "deeply held, radical" convictions on race, a former high school teacher said on Sunday.

He also confided that he had been diagnosed with schizophrenia when he was younger and had been prescribed an anti-psychotic medication, Derek Weimer, the teacher, said in an interview with AP news agency.

In high school, Fields was an "average" student, but with a keen interest in military history, Hitler, and Nazi Germany said Weimer, who said he was Fields' social studies teacher in his junior and senior years at Randall K Cooper High School in the US state of Kentucky.

"Once you talked to James for a while, you would start to see that sympathy towards Nazism, that idolisation of Hitler, that belief in white supremacy," Weimer said.

"It would start to creep out."

The mayor of Charlottesville, political leaders of all political stripes, and activists and community organisers around the country planned rallies, vigils and education campaigns to combat the hate groups.