Two police officers and one passerby were shot dead in the eastern Belgian city of Liege on Monday, with officials treating the attack as a terrorist incident.

The attacker was a radicalised "lone wolf" just out of prison who targeted police, according to the prosecutor's office.

The gunman, named by local media as 31-year-old Benjamin Herman, opened fire outside a cafe before moving to a nearby school where he took a cleaner hostage.

He initially followed two female police officers, aged 45 and 53, and then attacked them from behind with a knife, a press conference heard on Tuesday afternoon.

He seized their service weapons and shot them before continuing to his rampage, killing a 22-year-old man in a car that was parked at the scene.

When he left a nearby school — where he took a female cleaner hostage — he was shot dead by police.

Two police officers were injured "around their legs" in the shootout. Students from the school were moved to safety and none were harmed.

La Libre Belgique newspaper quoted a police source as saying the gunman shouted Allahu Akbar — God is great in Arabic — and RTBF said investigators believed the attacker may have had a terrorist motive.

Investigators are reportedly looking into whether the attacker had converted to Islam and had been radicalised in jail.

Belgian Prime Minister Charles Michel said the convict was indirectly mentioned in state security reports on radicalisation “in notes that did not primarily target him, but others or other situations.”

He says the attacks will involve, at least initially, “an investigation for terrorism.”

Look back at the blog below to see how events unfolded.