The suspect behind the Stockholm truck attack had been facing deportation and had extremist sympathies, Swedish police say.
The 39-year-old Uzbek man is suspected of having driven a truck into a department store in the city on Friday.
His application for residency was rejected in June last year and he was being sought by immigration officials, police said.
Meanwhile, a second suspect has been placed under formal arrest.
Police said they were investigating the second suspect for a “terrorist crime [by committing] murder”.
However, Reuters news agency said the person was arrested on “a lower degree of suspicion” than the first suspect.
Police have interviewed more than 500 people over the incident, Sweden’s TT news agency reports.
The first suspect had applied for permanent residency in 2014, but this was rejected, and in December 2016 he was given four weeks to leave the country, police chief Jonas Hysing told a press conference.
The suspect then disappeared, and police began searching for him, Mr Hysing added.
Four people are confirmed to have died in the attack. Police have not released their identities, but said they were:
- Two Swedish nationals
- A Briton – named by his family as 41-year-old Chris Bevington
- One Belgian national
Another 15 people were injured.
The truck, hijacked from a beer company, was driven into Ahlens department store in the capital on Friday afternoon.
No terrorist group has claimed to be behind the attack.
The first suspect, who has not been named, was known to the security services and was arrested later on Friday.
He had been seen only as a “marginal character”, National Police Commissioner Dan Eliasson said.
Police say the man was known to have expressed sympathy for groups including so-called Islamic State.
Witnesses: Truck was ‘trying to hit people’
Is terror threat to Europe greater today?
Sweden has taken in nearly 200,000 refugees and migrants in recent years – more per capita than any other European country.
However, there was a drop in numbers last year after the country introduced new border checks.
Separately, Sweden is believed to have the highest number of Islamic State group fighters per capita in Europe.
About 140 of the 300 who went to Syria and Iraq have since returned, leaving the authorities to grapple with how best to reintegrate them into society.
On Sunday, thousands of people gathered in central Stockholm for a “Lovefest” vigil against terrorism, and laid flowers outside the Ahlens shop in tribute.