STOCKHOLM — The Swedish police said on Saturday that they had arrested a 39-year-old Uzbekistan-born man they believed had hijacked a beer truck and carried out a terrorist attack by driving the truck into a crowd of people in Stockholm the day before, killing four and injuring at least 15 others.
Prosecutors and police officials did not identify the suspect, but Anders Thornberg, the head of the Swedish Security Service, said at a news conference that the man had been on the authorities’ radar some time ago.
Mr. Thornberg said that the agency had looked into information it received on the suspect last year, but that it had not led to anything. He said the suspect was not on any current list of people being monitored. “The suspect didn’t appear in our recent files, but he earlier has been in our files,” Mr. Thornberg said.
The Swedish national broadcaster SVT reported that a bag with explosives had been found in the truck used in the attack.
On Saturday, the police chief, Dan Eliasson, said: “We have found something in the truck in the driver’s compartment, a technical device that should not be there. I cannot say whether this is a bomb or some sort of flammable material.”
Prosecutors said the suspect had not spoken, and there was no immediate word of any criminal charges. But Chief Eliasson said there was “nothing to indicate we have the wrong person.” He added, “We cannot exclude the possibility that others are involved.”
Lars Bystrom, a spokesman for the regional police, said earlier on Saturday, “We have one person in custody, and we think he is the driver of the truck.”
Chief Eliasson would not say how long the suspect had been living in Sweden. “We are focusing on how he entered the country, where has he been,” he said. “We need to establish what kind of contacts he had.”
He said there were clear similarities with the deadly attack in London last month.
On Saturday, people placed flowers outside the department store in Stockholm where the attack occurred as a memorial to the victims. Karolinska Hospital said that six of the injured had been released. The police said eight people remained hospitalized.
The beer truck, stolen earlier on Friday, mowed down pedestrians along Drottninggatan, a busy pedestrian shopping street. It came to a stop after slamming into the Ahlens department store.
After the rampage, Prime Minister Stefan Lofven said: “Sweden has been attacked. This indicates that it is an act of terror.”
The manhunt brought transit systems to a halt and put Parliament under lockdown. The suspect was detained in a northern Stockholm suburb on Friday and later arrested on suspicion of having committed a terrorism crime, the police said.
Elias Broth, 19, a high school senior, was on a bus at the intersection of Drottninggatan and Kungsgatan when he heard a loud noise. “I look up and I see the truck passing by, driving really fast,” he said by phone on Saturday. “Then I heard a big boom when it crashed into people.”
He said he had stayed in the bus a bit longer, before taking shelter in a clothing store on Kungsgatan. “The first thing I saw when I stepped off the bus was a woman. Her body was in pieces,” he said.
Jean-Claude Juncker, the European Commission president, said in a statement on Friday: “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. An attack on any of our member states is an attack on us all.”
Initially, he said, he did not know what had happened, but as he made his way to his wife’s office, he saw people lying motionless and police officers with body armor rushing to the site.
He said he expected locals to bounce back quickly, though. “Swedes are pretty resilient people,” he said.
While the city was under lockdown, the hashtag #openstockholm sprang up on Twitter.
Jenny Nguyen, 22, a law student in Stockholm, said she had come up with the hashtag to encourage people to open their homes to commuters, tourists and others who were stranded after the transit system was shut down.
“This idea is actually not a new one,” she said in a phone interview. “I was following the attack in Paris when that occurred. I saw that someone started a hashtag to tell people where to go and where they could find company.”
“Suddenly, I felt the world was not as dark as people who commit these types of actions want it to be,” she said.