Belgium on Wednesday paid emotional tribute to two policewomen and a student shot dead in the eastern city of Liege as investigators probed the gunman's transition from years of petty criminality to "terrorist murder".
Prosecutors confirmed they were treating Tuesday's bloodshed as an act of terrorism, saying the shooter Benjamin Herman was also suspected of another murder the night before.
The Islamic State group claimed one of its "soldiers" was behind the attack, the jihadists' Amaq propaganda agency said later Wednesday.
Across Belgium, flags were flying at half-mast as Prime Minister Charles Michel led a minute's silence in Liege where around 1,000 people had gathered to pay their respects, among them many police officers.
Belgium's national football squad also halted a training session ahead of next month's World Cup to observe a minute's silence for the victims.
As police scrambled to unpick the gunman's motive for the attack, a dramatic account emerged of Tuesday's bloodshed, which began when the 31-year-old attacked two policewomen with a knife.
After repeatedly stabbing the policewomen, he grabbed their weapons and killed them in a modus operandi which has been encouraged online by extremists from the Islamic State group.
The two victims were identified as Lucile Garcia, 54, who had recently become a grandmother, and Soraya Belkacemi, 44, a mother to 13-year-old twins.
He then shot dead a 22-year-old student sitting in a parked car in the city centre before entering a nearby school where he briefly took a female cleaner hostage.
Speaking to the Derniere Heure newspaper, the cleaner, who gave her name only as Darifa, said he had asked her whether she was Muslim and if she was fasting for Ramadan.
When she answered "yes" to both questions, Herman said he would not harm her.
She then urged him to give himself up, telling him: "You shouldn't be here, this is a school, there are children!" after which he burst out for his final confrontation with police.
- 'Terrorist murder' -
Investigators are trying to understand how Herman, a drifter who spent a decade in and out of prison for violence and drug offences, came to carry out such a bloody attack.
"The facts are qualified as terrorist murder and attempted terrorist murder," prosecutors' spokesman Eric Van Der Sypt told a news briefing in Brussels.
He pointed to the fact that "the perpetrator shouted several times 'Allahu akbar'... and information from state security according to which the perpetrator was in touch with radicalised persons."
But he said information about Herman's contacts with extremists dated "from late 2016, early 2017" and had not been confirmed since.
Amateur footage obtained by AFP showed the gunman shouting "Allahu akbar" -- "God is greatest" -- as he walked through the streets.
In another video, Herman darts out of the school before a short and intense burst of police gunfire, after which he collapses on the ground.
Interior Minister Jan Jambon urged caution over the extremist angle.
"There are signals that there was radicalisation in the prison but did this radicalisation lead to these actions? There, too, we can ask ourselves a lot of questions," he told RTL radio.
Investigators are also examining whether Herman acted alone or had accomplices.
- Gruesome hammer murder -
Investigators are paying special attention to the gruesome killing of an alleged heroin dealer linked to Herman who was battered to death with a hammer late Monday in a village near the Luxembourg border.
They found the hammer in Herman's car on Tuesday.
Jambon said police believed he had carried out the killing just hours after getting temporary release from prison on Monday morning.
Liege, a major city in Belgium's blighted industrial rustbelt, was the scene of another bloody shootout in 2011 when another former convict killed six people and wounded more than 120 before turning the gun on himself.
Belgium has been on alert since January 2015 when authorities smashed a terror cell near Liege that was planning an attack on police. That cells had links to Abdelhamid Abaaoud, the mastermind of the November 2015 attacks on Paris that killed 130 people and was claimed by IS.
Flowers were piling up outside Liege police headquarters in tribute to the two policewomen killed in the latest attack
Map of Liege, Belgium, locating gun attack