"Thugs" who travelled to Southport to use the deaths of three children "for their own political purposes" were to blame for the violence that saw dozens of police officers injured, the town's MP has said.
Unrest broke out in the Merseyside town hours after a vigil to honour the victims of Monday's knife attack at a dance school in which three young girls were killed and eight other children injured.
Patrick Hurley said the disturbance close to a mosque, which saw officers pelted with bricks and a police van set on fire, had been "horrific".
Merseyside Police Federation's Chris McGlade said more than 50 police officers were hurt in a "sustained and vicious attack".
Merseyside Police said the violence was believed to have involved English Defence League supporters.
Mr Hurley told OceanNewsUK the "riot" was "led by people from outside the town".
He said the "thugs who had got the train in" had used the "deaths of three little kiddies for their own political purposes".
Mr McGlade said his injured colleagues were the same "courageous officers" who were themselves trying to come to terms with the "unimaginable tragedy" of Monday's attack.
"I utterly condemn the actions of these mindless and violent thugs - and they will be brought to justice for their actions," he added.
ACC Goss said it was "sickening" that the disturbance happened within a "devastated" community.
He said the force had faced "serious violence" and was "so proud to have witnessed off-duty officers parade back on duty to support their colleagues who had displayed such courage whilst under constant and sustained attack".
He also thanked officers from forces in Greater Manchester, Cheshire, Lancashire and North Wales for providing mutual aid and support.
He added that the disorder involved many people "who do not live in the Merseyside area or care about the people of Merseyside".
"Sadly, offenders have destroyed garden walls so they could use the bricks to attack our officers and have set cars belonging to the public on fire, and damaged cars parked in the mosque car park," he said.
"This is no way to treat a community, least of all a community that is still reeling from the events of Monday."
On Tuesday, Merseyside Police named six-year-old Bebe King, seven-year-old Elsie Dot Stancombe and nine-year-old Alice Dasilva Aguiar as the three girls who were killed at a Taylor Swift-themed dance workshop at the Hart Space studio in Hart Street.
At about 18:00 BST, more than 1,000 people joined a peaceful vigil was held outside the Atkinson gallery on Lord Street.
However, following rumours throughout the day of a demonstration, a group began to gather near a mosque on St Luke's Road, two streets away from Hart Street, at about 19:45 and engaged in a stand-off with police officers.
As the disorder escalated, the group attacked the front of the mosque, throwing bricks, bottles, fireworks and rocks, and officers donned protective gear and used riot shields to defend themselves as wheelie bins and other objects were hurled towards them.
A police vehicle was also set on fire.
Southport Mosque chairman Ibrahim Hussein said he had gone with colleagues to secure the building and had to be taken to a place of safety by police.
He told OceanNewsUK Merseyside that the group had "started to burn the fences and throw things burning stuff at the windows".
"They smashed all the windows, they broke all the fences and obviously, the chanting and the screaming and the anger just was overwhelming for all of us."
North West Ambulance Service said 27 officers were taken to hospital and 12 were treated and discharged at the scene.
Merseyside Police said those behind the violence had been fired up by social media posts which incorrectly suggested an Islamist link to Monday’s stabbings.
Home Secretary Yvette Cooper had earlier warned about disinformation linked to the attack.
A 17-year-old boy, who was arrested on suspicion of murder and attempted murder after Monday's attack, has no known links to Islam.
Assistant Chief Constable Alex Goss said there had been "much speculation and hypothesis" around the teenager and "some individuals" were using it to "bring violence and disorder to our streets".
"We have already said that the person arrested was born in the UK, and speculation helps nobody at this time."
Mr Hurley said it was "reprehensible" that police officers who had been attending injured victims on Monday were finding themselves "being pelted with bricks by these thugs".
He said they had "hijacked the grief" of the town and families.
"These people are utterly disrespecting the families of the dead and injured and totally disrespecting the town," he said.
A 24-hour Section 60 Order has been put in place, giving police extra stop and search powers.
A Section 34 Order has also been introduced, allowing police to direct people who were engaging in antisocial behaviour or were "likely to become involved in such behaviour" away from the area.
Merseyside Police said extra officers would remain in the area "to provide a visible presence and reassure communities".
Prime Minster Sir Keir Starmer said on X that the people of Southport were "reeling" after the "horror inflicted on them yesterday".
He said those who had "hijacked the vigil for the victims with violence and thuggery" had insulted the community and would "feel the full force of the law".
Families living nearby told the OceanNewsUK they feared for their safety as stones flew past and police officers rushed to put on riot gear and pick up shields.
"I can’t believe this is happening in Southport," one young woman shouted from the front of her car as she tried to drive her young daughter away.
The home secretary said it was "appalling" that police officers in Southport were facing attacks from "thugs on the streets who have no respect for a grieving community".
"I think everyone should be showing some respect for the community that is grieving and also for the police who are pursuing an urgent criminal investigation now, and who showed such heroism and bravery yesterday," she said.
Merseyside Police and Crime Commissioner Emily Spurrell also said she was "absolutely appalled by the disgraceful scenes of violence".
"This is a community which has faced unimaginable tragedy, and it is grieving," she said.
"Such behaviour is abhorrent and only causes further harm and suffering," she added.