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.
Reuters news agency said it was on “a lower degree of suspicion” than the first suspect.
The first suspect had been given four weeks to leave the country in December 2016, 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 – two Swedish nationals, a Briton and a Belgian, but police have not released their identities. Another 15 people were injured.
The truck, hijacked from a beer company, was driven into Ahlens department store in the capital on Friday afternoon.
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.
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.
Thousands of people have gathered in central Stockholm for a “Lovefest” vigil against terrorism, and have laid flowers outside the Ahlens shop in tribute.
Join GhanaStar.com to receive daily email alerts of breaking news in Ghana. GhanaStar.com is your source for all Ghana News. Get the latest Ghana news, breaking news, sports, politics, entertainment and more about Ghana, Africa and beyond.