A small group of conservatives cut short their “free speech rally” in Boston after thousands of demonstrators chanting anti-Nazi slogans confronted them.

The rally came a week after a gathering of hate groups led to bloodshed in Charlottesville, Virginia.

The counter-protesters marched through the city to historic Boston Common, where many gathered near a bandstand abandoned early by conservatives who had planned to deliver a series of speeches.

Counterprotesters hold signs at the free speech rally (Michael Dwyer/AP)Counterprotesters hold signs at the free speech rally (Michael Dwyer/AP)

Police vans later escorted the conservatives out of the area, and angry counter-protesters scuffled with armed officers trying to maintain order.

Members of the Black Lives Matter movement later protested on the Common, where a Confederate flag was burned and protesters pounded on the sides of a police vehicle.

Later Saturday afternoon, Boston’s police department tweeted that protesters were throwing bottles, urine and rocks at them and asked people publicly to refrain from doing so.

A man wearing a Trump T-shirt is hit by a flying plastic bottle of water (Michael Dwyer/AP)A man wearing a Trump T-shirt is hit by a flying plastic bottle of water (Michael Dwyer/AP)

About 10 minutes before that, President Donald Trump had complimented Boston police, tweeting: “Looks like many anti-police agitators in Boston. Police are looking tough and smart! Thank you.”

He also praised Boston’s Democratic mayor, Marty Walsh.

Boston Commissioner William Evans said 27 arrests were made — mostly for disorderly conduct while some were for assaulting police officers. Officials said the rallies drew about 40,000 people.

Mr Trump applauded the people in Boston who he said were “speaking out” against bigotry and hate. He added in a Twitter message: “Our country will soon come together as one!”

Organisers of the conservative event, which had been billed as a “free speech rally,” had publicly distanced themselves from the neo-Nazis, white supremacists and others who fomented violence in Charlottesville on August 12.

A woman was killed at that Unite the Right rally, and many others were injured, when a car ploughed into counter-demonstrators.

Opponents feared that white nationalists might show up in Boston anyway, raising the spectre of ugly confrontations in the first potentially large and racially charged gathering in a major US city since Charlottesville.

One of the planned speakers of the conservative activist rally said the event “fell apart”.

Counter-protesters hold signs at the Counter-protesters hold signs at the “free speech” rally on Boston Common (AP Photo/Michael Dwyer)

Congressional candidate Samson Racioppi, who was among several due to speak, told WCVB-TV that he did not realise “how unplanned of an event it was going to be”.

Some counter-protesters dressed entirely in black and wore bandannas over their faces. They chanted anti-Nazi and anti-fascism slogans, and waved signs that said: “Make Nazis Afraid Again,” “Resist fascism” and “Hate never made U.S. great”.

Chris Hood, a free speech rally attendee from Dorchester, said people were unfairly making it seem like the rally was going to be “a white supremacist Klan rally”.

“That was never the intention,” he said. “We’ve only come here to promote free speech on college campuses, free speech on social media for conservative, right-wing speakers. And we have no intention of violence.”

The Boston Free Speech Coalition, which organised the event, said it had nothing to do with white nationalism or racism and its group is not affiliated with the Charlottesville rally in any way.

Rallies also were planned in cities across the country, including Dallas, Atlanta and New Orleans.