Live television footage showed smoke coming out of the upscale Ahlens department store on the city's pedestrian street Drottninggatan, the store the truck smashed into about 3 p.m.
People in the downtown area fled in panic. Authorities evacuated the city's Central Station, which serves regional trains and the Swedish capital's subway system, which was a few hundred yards away. All trains to and from the main station were halted and two large shopping malls in the capital were shut down.
"Sweden has been attacked," Lofven said in a nationally televised press conference. "This indicates that it is an act of terror."
Broadcaster SVT said at least five people were killed in the attack while Swedish radio reported three dead, but police could not immediately confirm those reports. The country's intelligence agency said a large number of people were wounded in the crash.
"We stood inside a shoe store and heard something ... and then people started to scream," witness Jan Granroth told the Aftonbladet daily. "I looked out of the store and saw a big truck."
There was no immediate claim of responsibility for the attack and police in a later news conference said no one has been arrested, contradicting earlier Swedish media reports that one person was in custody.
"We have no contact with the person or persons who drove the truck," Sweden's top police chief, Dan Eliasson, told reporters.
"Right now, we have no one arrested," said Jan Evensson of the Stockholm police, who urged people not to drive into central Stockholm.
Swedish beer maker Spendrups said one of its trucks had been hijacked earlier Friday.
"It is one of our delivery trucks. In connection with a delivery to a restaurant called Caliente, someone jumped into the truck and drove it away while the driver was unloading his delivery," Spendrups spokesman Marten Luth told the Swedish news agency TT.
He said the original beer truck driver was not injured.
Sweden's security agency boss, Anders Thornberg, said the SAPO agency was working with police on the case and had no indications earlier that an attack was imminent.
Mats Loving of the national police's operational unit said police presence across the Scandinavian country had been stepped up.
Swedish King Carl XVI Gustaf cut short a visit to Brazil to return earlier than planned and sent the royal family's condolences to the families of the victims and those who were wounded.
The truck crash appeared to be the latest attack in Europe using a vehicle.
Last month, in an attack claimed by the Islamic State group, a man drove into a crowd on London's Westminster Bridge, killing three people and injuring many others before stabbing a policeman to death. He was shot dead by police. A fourth person, a woman thrown into the Thames by the force of the car attack, died Thursday.
The IS group also claimed responsibility for a truck attack that killed 86 people in Nice, France, in July during a Bastille Day festival last year and another truck attack that killed 12 people at a Christmas market in Berlin.
Condolences poured into Sweden on Friday from top European Union officials and German Chancellor Angela Merkel. In neighboring Finland, President Sauli Niinisto said he was shocked by the "maniac act of terror" in Stockholm.
"Every terror attack is to be equally condemned. But it touches us deeply when such an attack takes place in our Nordic neighborhood," Niinisto said.
Helsinki police said they were tightening security in the center of the Finnish capital.
EU Council President Donald Tusk said in a tweet Friday that "my heart is in Stockholm this afternoon. My thoughts are with the victims and their families and friends of today's terrible attack."
European Commission President Jean-Claude Juncker said "one of Europe's most vibrant and colorful cities appears to have been struck by those wishing it — and our very way of life — harm."
Juncker also said "an attack on any of our (EU) member states is an attack on us all" and that Sweden can count on EU help.
Friday's crash is near the site of a December 2010 attack in Stockholm in which Taimour Abdulwahab, a Swedish citizen who lived in Britain, detonated a suicide bomb, killing himself and injuring two others.
Abdulwahab rigged a car with explosives in the hope that the blast would drive people to Drottninggatan — the street hit Friday — where he would set off devices strapped to his chest and back. The car bomb never went off, and Abdulwahab died when one of his devices exploded among panicked Christmas shoppers.
Olsen reported from Copenhagen, Denmark. Matti Huuhtanen contributed from Helsinki, Finland.
Copyright 2017 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.