Update 6.28pm: State broadcaster RTBF has identified the suspect as Benjamin Herman.
Herman, a Belgian national born in 1982, had a criminal record that included theft, assault and drug offences, RTBF reported.
The federal prosecutor's office declined to comment.
Justice Minister Koen Geens said the assailant, who was later killed by police, was released from prison on a two-day leave Monday.
Mr Geens described him as a multiple repeat offender who had been incarcerated since 2003.
Liege Police Chief Christian Beaupere said at a news conference that the slain officers were 45 years old and 53 years old, the latter the mother of twins.
Four other officers were wounded in the attack, one of them seriously with a severed femoral artery.
4.45pm: Officers killed in Belgium shooting were women, police chief confirms
The police chief in the Belgian city of Liege says that a knife-wielding man stabbed two female officers before taking their handguns and shooting them both dead.
Christian Beaupere said the attacker, whom he did not name, also wounded four other officers.
He said: "The goal of the attacker was to target the police."
He said the policewomen were aged 45 and 53, the latter a mother of twins.
The attacker also killed a passer-by before police fatally shot the gunman.
Update 1pm: A knife-wielding man stabbed two police officers in the Belgian city of Liege, stole their weapons, and shot then them and a bystander dead in an attack that prosecutors fear could be terror-related.
The man, who was later killed by police, approached two police officers from behind while carrying a knife and stabbed them several times, said Philippe Dulieu, spokesman for the Liege prosecutor's office.
"He then took their weapons. He used the weapons on the officers, who died," Mr Dulieu told reporters.
Mr Dulieu said the attacker then shot dead a 22-year-old man in a vehicle parked nearby, and took a woman hostage in a school close to where the shooting took place outside a city cafe.
"Liege police intervened. He came out firing at police, wounding a number of them, notably in the legs.
He was shot dead," the spokesman said.
A senior official at the federal prosecutor's office told The Associated Press that "there are indications it could be a terror attack".
Despite this, Belgium's crisis centre said it saw no reason to raise the country's terror threat alert for now.
Earlier: A gunman has killed three people, including two police officers, in the Belgian city of Liege, a city official said.
Police later killed the attacker, and other officers were wounded in the shooting.
The motive for the attack was not immediately clear. State broadcaster RTBF reported that it could be terror-related, citing unnamed police and fire officials.
Belgium’s prime minister could not confirm the report.
“Beyond the attacker, who was shot, there are three dead, two police officials and a passer-by,” Michel Firket from Liege city hall told The Associated Press.
State broadcaster RTBF reported that the shooting took place near a cafe on Liege’s Boulevard d’Avroy.
A passenger in a car driving by was killed. Other police officers were wounded in the exchange of fire, Mr Firket told reporters.
When asked about the report that the attack was terror-related, Mr Firket said: “I know nothing formal about that. The police is doing its investigation. There are no formal conclusions.”
RTBF said the gunman fled the scene, taking a female cleaner hostage at a nearby school before he was shot.
A spokeswoman for the city mayor’s office, Laurence Comminette, said that the children were all safe.
Violence lâche et aveugle a #Liège. Tout notre soutien pour les victimes et leurs proches. Nous suivons la situation avec les services de sécurité et le centre de crise.— Charles Michel (@CharlesMichel) May 29, 2018
Speaking on Belgian television, Prime Minister Charles Michel said: “There was a serious incident.”
“The information so far is not clear yet,” he said.
Mr Michel was rushing to the crisis centre to get more information.
Video posted on Twitter by a person claiming to be a witness showed people running in the area. About six gunshots could be heard.
Belgian police and military have been on alert since suicide bombers killed 32 people at the Brussels airport and subway system in 2016.
- Press Association