Rakhmat Akilov was also convicted of the attempted murder of 119 other people who were at the scene of the attack.
The killings shocked a nation that had largely considered itself safe from the kind of militant assaults that have hit France, Spain, Britain and other countries in recent years.
"The defendant has among a series of crimes been found guilty of (a) terrorist offence by murder in five cases. The penalty has been set to life imprisonment," the Stockholm District Court said in a statement.
"He has also been found guilty of 119 cases of attempted murder, which have been labelled as (an) attempted terrorist offence."
Akilov hijacked a beer truck outside a restaurant in central Stockholm on April 7 last year and sped about 500 metres (yards) down a pedestrian street, ploughing into shoppers before crashing the vehicle into a department store.
Sweden has taken part in international peacekeeping missions in Mali, Afghanistan, Iraq, Kosovo and other states in recent years, but has not fought a war in more than two centuries.
Soon after the attack, Prime Minister Stefan Lofven said Sweden would stick by its open, liberal values.
Life sentences in Sweden are usually commuted to a fixed term.
(Except for the headline, this story has not been edited by NDTV staff and is published from a syndicated feed.)
Election Results for Lok Sabha Election 2019 will be out on May 23. Get the latest election news and live updates on ndtv.com/elections. Catch all the action on NDTV Live. Like us on Facebook or follow us on Twitter and Instagram for news updates from each of the 543 parliamentary seats for the election 2019