A man who shot dead two police officers and a bystander in the city of Liege had already killed another person the day before the attack, Belgian Interior Minister Jan Jambon says.
The shooter, a Belgian national called Benjamin Herman, also took a woman hostage during his rampage on Tuesday, and Jambon said she may have talked him down and helped to avoid more deaths inside the school.
"He also committed a murder the night before," Jambon told broadcaster RTL.
Jambon confirmed that 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.
During Tuesday's attack, Herman, who was on a two-day release from prison, crept up behind two female police officers, stabbed them repeatedly, stole their handguns and shot them in the back.
He also shot dead a man sitting in a nearby car. Shortly after taking the woman hostage he ran from the school firing at police and was gunned down.
Belgian federal magistrate Wenke Roggen said the attack is being treated as terrorism.
Herman, shouted "Allahu akbar," the Arabic phrase for "God is great", several times during spree, which Roggen said resembled Islamic State calls to attack police with knives and steal their weapons.
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 minister said an investigation has been launched into the incident, including the circumstances surrounding his release from prison.
"It's really an isolated case. He wasn't part of a network, he did not 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 have been 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.