BRUSSELS (AP) — The man who killed four people in the Belgian city of Liege this week carried out an act of “terrorist murder” and may have intended to cause more carnage, prosecutors said Wednesday, as authorities tried to establish whether he acted alone.

Benjamin Herman, an inmate on a two-day prison furlough, attacked two female police officers from behind with a knife on Tuesday, stabbed them repeatedly, stole their handguns and shot them as they lay on the ground, officials said. Crossing the road, he fired several shots at a 22-year old man who was a passenger in a car, killing him. Herman then took a cleaning woman hostage at a nearby school. When police closed in, he ran out onto the sidewalk firing and police fatally shot him. Four officers were wounded.

He yelled “Allahu akbar,” the Arabic phrase for God is great, several times during Tuesday’s rampage, prosecutors said. Officials later confirmed that Herman had also killed another person Monday.

The attack has shaken Belgium where police and military have been working overtime to guard public buildings for two years since coordinated suicide attacks on the Brussels airport and subway system killed 32 people and injured hundreds on March 22, 2016.

Belgian federal magistrate Wenke Roggen said Wednesday that the attack was considered “terrorist murder and attempted terrorist murder.” She said it’s being treated as terrorism given the way Herman acted, which she says resembled Islamic State calls via video to attack police with knives and steal their weapons, the fact that he yelled “Allahu Akbar” and was in contact with radicalized people.

The attack started outside a Liege cafe and Roggen said the attacker went in and out of it a few times after shooting the officers but that people inside had fled or hidden thanks to the quick thinking of the owner.

An investigating magistrate specializing in terrorism has ordered autopsies on those killed at the scene and a toxicology examination of the attacker.

Prosecutors said Herman has had several run-ins with police since he was a minor. He has been sentenced on assault, drug and insubordination charges. He left prison early Monday on furlough and should have returned Tuesday evening.

“He also committed a murder the night before,” Interior Minister Jan Jambon told broadcaster RTL. Jambon said the fourth victim was a former inmate who did prison time with Herman. Herman is alleged to have killed the man on Monday evening by hitting him over the head with a blunt object.

Jambon added that the woman he took hostage may have talked the shooter down and helped to avoid more deaths inside the school.

Jambon, Prime Minister Charles Michel and King Philippe visited the woman in hospital, where she was being treated for shock.

“She was very courageous and perhaps, but this we will have to verify, she helped avoid more victims in the school,” Jambon said.

The cleaning woman, identified only by her first name Darifa, told state broadcaster RTBF that Herman said he just wanted to “stir up” the police. He asked her if she was a Muslim and if she was observing the holy fasting month of Ramadan.

“He told me don’t worry, I won’t do anything at all. Listen, you do what I say, but don’t worry. I won’t do anything to you,” the woman said.

She said he threw his ID card on the ground before running out to confront the police.

“I think he knew that it was all over for him. And he went out,” she said.

Jambon said an investigation has been launched into the incident, including the circumstances surrounding Herman’s release from prison.

“It’s really an isolated case. He wasn’t part of a network, he didn’t receive instructions from anyone else, so there is no need to raise the terror threat alert level,” Jambon said, adding that investigators have no precise information that any other attacks might be likely.

Amid questions about how two officers could have been disarmed, Jambon praised the work of all involved, saying “the police did an extraordinary job.”

“They reacted well. All the systems, all the procedures worked. But if you are attacked from behind, as was the case with the two officers, you can’t do anything,” he said.

The police officers have been identified as Soraya Belkacemi, 44, and Lucile Garcia, 54. The passenger in the car was named as Cyril Vangriecken, 22, who was preparing to become a primary school teacher.

Belgian media reports named the man killed before Tuesday’s rampage as Michael Wilmet.

In Liege, the mother of Soraya Belkacemi, Bernadette Hennart, kissed a necklace and laid it over flowers at the scene, saying it was important for her and the victim’s brother to visit the place where her daughter spent her last moments alive.

Hennart said that they had come “to piece things together. No one has told me very much. Only through the media, and it’s not nice. I can’t stand watching it. I can’t say goodbye to her.”

Flags were flying at half-staff on public buildings around the city and people gathered to sign a book of condolences and lay flowers in memory of the victims. The prime minister joined others at the scene in a minute’s silence. Police and security officials also assembled in Brussels and Antwerp to mourn the loss of their two colleagues.

“Every morning I am scared that something like this will happen, and every day it happens closer to home,” Melissa Lamny told The Associated Press after wrapping flowers around a lamppost at the scene of the killings.

___

Mark Carlson and Sylvain Plazy in Brussels, and Bishr Eltouni in Liege, contributed to this report.