People lay flowers in front of a plywood plank covered with messages at the Stockholm department store where the truck attacker struck. (Markus Schreiber/AP)

Swedish police said Sunday that the man suspected of plowing a stolen truck into a crowd of people in Stockholm’s busiest shopping area on Friday had had his residency application rejected and was supposed to be deported last year but could not be located.

In a midday news conference, officials said the 39-year-old ­Uzbek man, who has not been publicly identified, was denied permanent residency status in June and was sought for deportation last summer. But he went into hiding, and in February police issued a notice seeking clues about his whereabouts, said Jan Evensson, a Stockholm police official.

The man resurfaced Friday, when authorities say he killed four people and injured 15 others during a rampage that ended when the beer-delivery truck he is accused of steering slammed into an upscale department store in central Stockholm. The driver ran away. But police arrested a man that evening in the northern Stockholm suburbs and said his appearance matched that of a man caught earlier in the day on surveillance video. Over the weekend, authorities expressed confidence that the man they arrested was responsible for the attack.

No group has asserted responsibility. But the suspect had shown an interest in Islamic State and “has been sympathetic to extremist organizations,” said Jonas Hysing, an official with Sweden’s national police.

Authorities said five other people have been arrested in connection with the case, suggesting the possibility of a broader plot, though no charges have been filed. Police said that 500 people have been questioned.

The revelation that the suspect in Stockholm’s first mass-casualty terrorist attack was an Uzbek who had sought and failed to secure residency is almost certain to inflame debate over the country’s relatively welcoming attitude toward foreigners.

Speaking Sunday to his party’s annual conference, Swedish Prime Minister Stefan Lofven said that his government would review immigration legislation with the goal of making it easier to remove people whose applications to stay in Sweden have been rejected. There are thought to be thousands of cases of people who have stayed in Sweden despite having been told to leave.

“It makes me frustrated. If you are rejected, you should go home,” he said. “We need to improve the ability to deport people.”

Lofven has said that Friday’s attack was “an act of terrorism.”

Authorities did not say exactly when the suspect came to Sweden from Uzbekistan, a country known for political oppression, but they said he applied for permanent residency in 2014.

During the peak of Europe’s refu­gee crisis, in 2015, Sweden accepted a record-breaking number of asylum seekers — nearly 163,000 in a country where the population is fewer than 10 million.

With its systems for welcoming newcomers strained to the breaking point, Sweden abruptly tightened its policies late that year. In 2016, as the number of asylum seekers dropped across the continent, Sweden accepted fewer than 30,000.

Police said Sunday that of the four dead in the truck attack, two were Swedes, one was Belgian, and one was British.

The British national was identified as 41-year-old Chris Bevington, who worked in Stockholm for the music streaming service Spotify. His father, John Bevington, described his son as “a wonderful husband, son, father, brother and close friend to many.” John Bevington said the family was “devastated.”

One of the Swedish victims was an 11-year-old girl who was on her way home from school. Details about the other victims were not immediately available.

Thousands of people rallied Sunday afternoon in central Stockholm to show solidarity with the victims. Among the injured, 10 remained in the hospital as of Sunday evening.

Stockholm is one among a growing list of European cities where vehicles have been turned into deadly weapons by terrorists in the past year, including Berlin, London and Nice, France.

Witte reported from London.

Read more:

What cities are trying to stop terrorists who use trucks as weapons

Teen asylum-seeker ID’d as suspect in Norway explosive case

A terrorist attack in London and the all-too-familiar response

Today’s coverage from Post correspondents around the world

Like Washington Post World on Facebook and stay updated on foreign news