Three young children and a woman in her 30s were injured near a school in Dublin on Thursday, the police said, an attack that was followed by destructive riots that they blamed on the far right weaponizing “misinformation” about the episode.

An adult woman in her 30s and a 5-year-old girl sustained serious wounds in the attack, in which a knife was used, the police said, while a 5-year-old boy and a 6-year-old girl were being treated for less serious injuries. The boy was later released from hospital.

A suspect in the case was in custody, according to the Garda Síochána, the Irish police force. Drew Harris, the Garda police commissioner, said that the motive for the attack remained “entirely unclear.”

The attack, which the police described as “a serious public order incident,” took place at Parnell Square East, in central Dublin, shortly after 1:30 p.m. on Thursday.

That evening, violent scenes broke out in the city after a group of rioters attacked police vehicles and set fires. Videos from the scene showed stores being looted, police cars and public buses aflame, and people clashing with police officers.

In the wake of the attack, far-right figures spread rumors online about the nationality of the attacker, and the news service AFP said that one protester told them that “Irish people are being attacked by these scum.”

The police said the suspect in custody was a man in his late 40s or early 50s, who was also injured, but they did not give further information about him. They blamed a far-right faction for the disorder on Thursday and asked people to leave the streets.

Mr. Harris said the riots were “disgraceful,” and suggested they were driven by misinformation about the knife attack that was being spread online for “malevolent purposes.”

Liam Geraghty, a spokesman for the police, said at a news conference that preliminary information suggested the knife attack was a stand-alone event and not an act of terrorism. He added that investigators were following a definite line of inquiry and were not looking for other suspects.

The police force said in a statement later that it was keeping “an open mind at this early stage of the investigation.”

“An attack on children is an act of absolute cowardice and depravity,” Gary Gannon, a member of Parliament for the area, wrote in a statement.

Ireland’s president, Michael D. Higgins, said the knife attack was an appalling incident and that his thoughts and prayers were with the children and their families. But he added that it was a matter for the police. “That it would be used or abused by groups with an agenda that attacks the principle of social inclusion is reprehensible,” he said, referring to the far right protesters, “and deserves condemnation by all those who believe in the rule of law and democracy.”

Bystanders had helped tackle the assailant, according to Mr. Geraghty. “My understanding is members of the public did intervene at a very, very early stage,” he said, “and we would applaud those members of the public for getting involved in such a traumatic and potentially dangerous situation for themselves.”

The five injured people were taken to hospitals in the Dublin region, according to the police, who said they were in contact with all the children’s parents.

In a statement, the Irish justice minister, Helen McEntee, called the knife attack “an appalling crime” but said “the scenes we are witnessing this evening in our city center cannot and will not be tolerated.”

“A thuggish and manipulative element must not be allowed use an appalling tragedy to wreak havoc,” she said, appealing for calm.