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 has reported.
On Sunday, people gathered in central Stockholm for a "Lovefest" vigil against terrorism, and laid flowers outside the Ahlens shop in tribute.
More than 20,000 people attended the vigil, AFP reported, citing city officials.
City mayor Karin Wanngard told the crowds: "Terror cannot win... instead we shall think of the kindness and openness that characterises our city."
The first suspect has been named by Swedish media, but police have not formally identified him.
He 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 man then disappeared, and police began searching for him, Mr Hysing added.
He was known to have expressed sympathy for groups including so-called Islamic State, but had been seen only as a "marginal character", police said.
Four people are confirmed to have died in the attack; two Swedish nationals - one reported to be an 11-year-old girl, a British man and a Belgian woman. Another 15 people were injured.