The gunman also killed a 22-year-old male car passenger on the Boulevard d’Avory, before taking a female cleaner hostage at a nearby high school.
She was released when police shot dead the attacker, who has been named by local media as Belgian national Benjamin Herman.
The 36-year-old was released from prison on Monday for a few hours but he failed to return. He was serving time for drug offences, media reported.
It is thought he may have been radicalised in jail. An AFP source close to the investigation he had contacts with radical Islamists and had “been reported or presumed to be belonging to the entourage of an Islamist recruiter”.
The incident is being treated as terrorism and Liege police chief Christian Beaupere said the attacker’s goal was to “target police”.
Officials say he approached the officers from behind and stabbed them repeatedly before taking their weapons and shooting them.
Prosecutor Philippe Dulieu said: “Armed with a knife, the suspect followed and attacked two police officers, and used their own firearms to kill them.”
“He continued on foot, attacking a parked vehicle where he opened fire on a 22-year-old man in the passenger seat. The young man died.
“He then continued and entered the Leonie de Waha school. He took a woman working there as hostage.
“Police intervened, he came out firing on the police officers, wounding several before he was killed.”
The governor of Liege province, Herve Jamar, said no-one was injured during the high school hostage-taking and all students were safe.
Authorities said terrorism could not be ruled out and media reports said the man shouted “Allahu Akbar” – “God is greatest” in Arabic.
A senior official at the prosecutor’s office told reporters “there are indications it could be a terror attack”.
Eric Van Der Sypt, a spokesman for the Belgian federal prosecutor’s office, said there were “elements that point in the direction that this is a terrorist act”.
Interior minister Jan Jambon said the anti-terrorist crisis centre was monitoring the situation which began to unfold at around 8.30am GMT.
Mr Jambon said: “Our thoughts are with the victims of this horrible act. We are in the process of establishing an overview of exactly what happened.”
The crisis centre said a security cordon had been set up around the area and urged people to stay away.
“It (terrorism) is one of the questions on the table, but for the moment all scenarios are open,” a spokesman for the crisis centre said.
Images on social media showed people scurrying for safety on Liege’s central boulevard d’Avroy with shots and sirens being heard in the background.
One video showed two police officers in body armour moving into position.
Prime Minister Charles Michel said his thoughts were with the families of the victims after what he called a “serious incident” but added he would not give further details at this stage.
Theresa May said the UK would stand together with its allies in the fight against terror.
The Prime Minister tweeted: “My thoughts are with the victims of today’s cowardly attack in Belgium and their grieving families.
“The UK stands resolute with our Belgian allies against terror.”
French President Emmanuel Macron voiced “solidarity” with Belgium, condemning it as a “terrible attack”.
Authorities said it was unlikely the terror threat level for Belgium would be raised.
Liege is an industrial city close to the German border in the French-speaking Wallonia region.
More from World
Israeli jets bomb militants after ’25 mortars fired from Gaza’
‘Locked in’ – The devastating effects of Israel’s Gaza blockade
Thunderstorms kill 47 as freak weather hits India
Stock markets across Europe rattled by Italy crisis
Boris Becker separates from wife Lilly after nine years of marriage
North Korean official flying to NYC in bid to save Trump-Kim summit
It was the scene of a shooting in 2011 when a gunman killed four people and wounded more than 100 before turning the gun on himself.
Belgium has been on high alert since a Brussels-based Islamic State cell was involved in attacks on Paris in 2015 that killed 130 people and Brussels in 2016 in which 32 died.