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

Rakmat Akilov had said he wanted to punish Sweden for joining a coalition against Islamic State.

In January, he was charged with terror-related murder and attempted murder for the attack with a stolen beer truck on April 7 2017.

Briton Chris Bevington, a 41-year-old executive at Swedish music-streaming service Spotify, was among the victims, which also included 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 defence lawyer Johan Eriksson said his client had been co-operative throughout the investigation and should be given a time-limited sentence.

During the court proceedings that started on February 13 and ended on May 2, Mr 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 crashing into the upscale Ahlens department store in Stockholm's city centre, Akilov also planned to blow himself up.

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.

Judge Palmkvist said the fact that Akilov had been co-operative and had confessed did not have any influence on the lifetime sentence, which is the heaviest penalty in Sweden and is normally about 18 years.

The court sentenced Akilov to be expelled from Sweden after he serves his sentence and banned him from returning.

Akilov was born in Uzbekistan and worked there as a construction worker.

He came to Sweden in 2014 and applied for asylum, claiming he had been persecuted.

His application was rejected and he was ordered to leave Sweden in December 2016.

Instead he went underground, eluding the authorities' attempts to track him down.

Sweden's domestic intelligence agency has said it had nothing indicating that he was planning an attack.

On April 6 - the eve of the attack - Akilov swore allegiance to IS.

During the trial, evidence showed how Akilov used 53 Sim cards and social media - including WhatsApp, Telegram, Viber, Facebook and Zello - to communicate with others about his activities.

Akilov has said he proposed carrying out an attack in Stockholm to IS on their behalf. It was not clear whether the group had accepted his offer.

Investigators have found internet chat logs with unknown people in which Akilov discussed becoming a martyr.

They have also found a memory card with execution videos and thousands of photos, including one of IS leader Abu Bakr al-Baghdadi.