Live television footage showed smoke coming out of the upscale Ahlens department store on the city's pedestrian Drottninggatan Street, which the truck smashed into.
People in the downtown area fled in panic, and Stockholm's nearby Central Station for trains and the subway, a few hundred yards away, was evacuated. All trains to and from the main station were halted. Two large shopping malls in Stockholm were shut down.
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.
"Sweden has been attacked," Lofven said in a nationally televised press conference. "This indicates that it is an act of terror."
There was no immediate claim of responsibility for the attack.
"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."
Police said there were no indications of shooting in the area, as Swedish broadcaster SVT reported earlier. Police in a later news conference said no one has been arrested, contradicting earlier Swedish media reports.
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.
Lofven, who was visiting a school in central Sweden where three students died in a bus crash Sunday, said he and the Swedish government were being updated constantly on developments.
Condolences poured in to Sweden from top European Union officials and German Chancellor Angela Merkel. Sweden's King Carl XVI Gustaf said the royal family sends its condolences to the families of the victims and injured.
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 measures 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 that "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 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 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.
Vehicles have been common weapons in recent extremist attacks.
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 has also claimed responsibility for a truck attack that killed 86 people in Nice, France, in July during a Bastille Day festival and another truck attack that killed 12 people at a Christmas market in Berlin.
Report a typo to the ABC13 staff