The suspect had also been due to be expelled from Sweden after his residency application was rejected.
"He applied for a permanent residency permit in 2014. The Migration Agency rejected it in June 2016 and also decided that he was to be expelled," Jonas Hysing, a police chief, told a press conference in Stockholm on Sunday.
The Swedish Migration Agency had handed over the case to the Stockholm police after the 39-year-old absconded. He has been wanted by the police in February.
"In December 2016, he was informed by the Migration Agency that he had four weeks to leave the country. In February 2017, the case was handed over to the police to carry out the order, since the person had gone underground," Hysing said.
Police also said at the Sunday press conference that all four victims of the attack have been identified. Two Swedes, one British national and one Belgian are confirmed dead.