One person was arrested.
People in the downtown area fled in panic, and Stockholm's Central Station for trains and the subway, which is a few hundred yards from the scene, was evacuated.
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."
More From This Section
Police said there were no indications of shooting in the area, as Swedish broadcaster SVT reported earlier.
There was no immediate claim of responsibility for the attack. The prime minister said one person was arrested, but gave no further details.
"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."
Lofven, who was visiting a school in central Sweden hit by a bus crash Sunday that killed three high school students, said he and the Swedish government were being updated on developments.
Today'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 today - 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.
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 yesterday.