An Uzbek man suspected of ramming a truck into a crowd in Stockholm, killing four people, had expressed sympathy for the so-called Islamic State and was wanted for failing to comply with a deportation order, Swedish police have said.

Thousands gathered in the spring sunshine near the site of Friday's attack to show support for those killed or injured when a hijacked beer delivery truck hurtled down a busy shopping street before crashing into a store and catching fire. The Uzbek man was arrested several hours later.

"The suspect had expressed sympathy for extremist organisations, among them IS," Jonas Hysing, chief of national police operations, told a news conference.

The Stockholm suspect, aged 39 and from the Central Asian republic of Uzbekistan, applied for permanent residence in Sweden in 2014. However, his bid was rejected and he was wanted for disregarding a deportation order, Mr Hysing said.

Police had been looking for him since Sweden's Migration Agency in December gave him four weeks to leave, but security services had not viewed him as a militant threat.

Two of those killed were Swedes, one was a British citizen and the other from Belgium, Mr Hysing said of the attack, which echoes the earlier use of vehicles as deadly weapons in Nice, Berlin and London. Those attacks were claimed by Islamic State, but there has been no such claim yet for the Stockholm assault.

Chris Bevington, 41, has been named as the British victim.

In a statement his father John Bevington said: "We are all devastated by the untimely and tragic death of our talented, compassionate and caring son Chris.

"A wonderful husband, son, father, brother and close friend to many."

The attack deeply shocked the usually tranquil Scandinavian nation, which prides itself on its openness and tolerance.

Sweden's prosecution authority said a second person had been arrested on suspicion of having committed a terrorist offence through murder, but police said they were more convinced than ever that the Uzbek man was the driver of the truck.

Another five people were being held for questioning after raids and police said they had conducted about 500 interviews.

Flags flew at half-mast at public buildings across Stockholm.

Prime Minister Stefan Lofven, who beefed up border controls after the attack, announced a national minute of silence to be held in honour of the victims tomorrow at noon.

"Today, all of Sweden is in mourning, but we're going to get through this together," he told reporters after laying a bouquet outside the Ahlens department store.

King Carl XVI Gustaf, who returned to Stockholm yesterday after cutting short a visit to Brazil, also addressed the nation outside the palace.

"The consideration people are showing each other shows the strength of our society," he said.

"There are so many of us who want to help, many more than those who want to hurt us."