An Uzbek man who drove a stolen truck into a crowd in Stockholm, killing five people and wounding 14 others, was convicted Thursday of terror-related murder and given a life sentence.

Rakmat Akilov had said he wanted to punish Sweden for joining a coalition against the Islamic State group. In January, he was charged with terror-related murder and attempted murder for the attack with a beer truck on April 7, 2017.

Those killed were a British man, a Belgian woman and three Swedes, including an 11-year-old girl.

Judge Ragnar Palmkvist said Akilov, 40, was the only suspect in the attack, and that prosecutor Hans Ihrman called him a "security risk to society" during his trial at the Stockholm District Court.

The prosecution had demanded a life sentence while defense lawyer Johan Eriksson said his client had been cooperative throughout the investigation and should be given a time-limited sentence.

During the court proceedings that started Feb. 13 and ended ending May 2, Ihrman said that "Akilov took the right to determine the fate of so many people. Now it is the turn of the democratic rule of law to determine the fate of Akilov."

After ploughing the truck into a crowd of shoppers on a busy shopping street and crashed into the upscale Ahlens department store in Stockholm's city center, Akilov also planned to blow himself. He failed, and caused a smaller explosion inside the truck when a suspected bomb made of five gas canisters with dozens of screws, blades and smaller metal objects went off.

Akilov then escaped via Stockholm's subway system but was arrested hours later in a suburb.

He was found guilty of five counts of terror-related murder, 119 counts of attempted murder and 24 cases of endangering the life of others.