Swedish prosecutors ordered the release on Sunday of a man held on suspicion of plotting a "terrorist crime", saying he was no longer a suspect.
Moder Mothama Magid, 22, was arrested on Thursday after a day-long nationwide manhunt during which Sweden was put on its highest ever terror alert. He was suspected of having plotted in Stockholm to carry out an unspecified "terrorist crime". He had said he was innocent.
"The man is no longer a suspect," prosecutor Hans Ihrman said in a statement.
Magid's arrest in a building complex housing asylum seekers in northern Sweden unnerved the country as it came only days after the Islamist militant attacks in Paris that killed 130 people.
The warning of a high probability of an attack had prompted many commuters in Stockholm to avoid mass transit trains and triggered a security clampdown at potential targets as well as a government push to increase surveillance.
But initial praise for Magid's swift apprehension soon turned into criticism in Swedish media with evidence Magid had an open Facebook account and had no made effort to hide his whereabouts.
His Facebook account said Magid, identified by media reports as Iraqi, had been in Sweden since September.
Swedish security police are keeping the threat assessment level at its highest ever level, four on a scale of five, meaning a high probability "persons have the intent and ability to carry out an attack".
Prosecutors said investigations continued.
"There is still reason to believe that preparations for terrorist crimes took place. Continued investigative measures will be taken in order to clear up the matter," Ihrman said in a statement.
Magid was arrested on "good grounds" of planning an attack, the second lowest of four levels of criminal suspicion in the Swedish legal system.
(Reporting by Johan Ahlander; Editing by Alistair Scrutton and Ros Russell)