Nordine Amrani was known to Belgian police as a gun enthusiast long before the day he killed at least four people and himself, wounding more than 120.
The man who left his home in Liege on Tuesday with a Fal assault rifle, hand grenades and a revolver had received a five-year prison sentence in 2008 for possessing a large arsenal and growing cannabis.
However, a court of appeal acquitted him of the gun conviction a year later on the grounds that he had had the necessary permissions to keep them, his lawyer Jean-Francois Dister told La Libre Belgique newspaper.
When he was paroled in 2010, his guns were not returned because of his drug-dealing conviction but otherwise he was under no special gun restrictions, Mr Dister explained.
According to Liege public prosecutor Daniele Reynders, the paroled man showed no sign of mental instability.
At the time of the massacre, he was again in trouble with the police, but this time in a vice case.
Indeed, the 32-year-old had been due to attend a police station for questioning on the day he launched his attack.
Amrani was born in the Ixelles district of Brussels on 15 November 1978, of Moroccan extraction.
A welder by profession, he was constantly in trouble with the law, Liege chief prosecutor Cedric Visart de Bocarme said.
"He was a felon who had been in trouble all his life: youth court, criminal court, courts of appeal," he said.
He had, among other things, a vice conviction in 2003.
A weapons aficionado, he was said to be able to dismantle, repair and put together all sorts of weapons but was never linked to any terrorist act or network, AFP news agency reports.
When he was arrested in 2008, police found 2,800 cannabis plants he was growing in a warehouse.
They also found 10 guns and 9,500 gun parts.
The arsenal included a Law rocket launcher, an AK-47 assault rifle, a sniper rifle, a K31 rifle, a Fal assault rifle and hundreds of cartridges, Le Soir newspaper reports.
"Amrani made silencers himself," its article notes.
"At the time, Amrani refused to say where the weapons had come from and where they were destined."
Le Soir adds that the decision of the court of appeal to acquit Amrani of the gun possession charges was linked to "grey areas" left by a change in classification in Belgium's gun law of June 2006.
Vice police had wanted to question Amrani over an incident at a party in November, Mr Dister told La Libre Belgique, without giving details.
He was due to appear at a Liege police station at 13:30 (12:30 GMT), not far from St Lambert Square.
Instead, he attacked the square at 12:30 in a burst of violence which ended when he shot himself dead.
"He was afraid of being taken into custody," said the lawyer.
"He phoned me twice on Monday afternoon and on Tuesday morning."
At his client's request, Mr Dister phoned a substitute lawyer and the police investigator.
"It seemed the new case was not particularly serious but Mr Amrani thought he was being picked on," the lawyer said.
"He explained to me that he had been questioned over an abduction. According to him, he had been framed and someone was out to get him. Mr Amrani had a grievance against the law."
After searching addresses associated with Amrani, and finding the body of a murdered woman, prosecutors said they had not found any message from the gunman.
The woman, who had been shot through the head, was found in the same warehouse where Amrani cultivated cannabis in 2008, prosecutors confirmed.