The Stockholm truck attack suspect has confessed to a “terrorist crime”, his lawyer said at a court hearing in the Swedish capital.
Rakhmat Akilov, 39 and from Uzbekistan, admitted carrying out the attack in court and was remanded in custody.
Wearing green overalls, he was brought into the court in handcuffs.
Four people were killed when a lorry was driven into a department store on Friday. A number of people were also injured, two critically.
“His position is that he admits to a terrorist crime and accepts therefore that he will be detained,” said lawyer Johan Eriksson.
A second man is no longer being held as a suspect, according to prosecution authorities, but he will not be released because he already had a deportation order standing against him.
Security was tight and the press gallery was full, according to a BBC correspondent at the court session, which was conducted behind closed doors.
Mr Akilov was told to remove a green blanket from his head before the hearing started.
He will have certain restrictions placed on him while in custody, including not being able to use mobile communications.
Swedish police said Mr Akilov was known to security services.
He had been denied residency in Sweden and had expressed sympathy for so-called Islamic State (IS), they said.
No group has claimed to be behind the attack.
Mr Akilov reportedly ran from the scene of the attack, still covered in blood and glass, and was arrested hours later in a northern suburb of Stockholm.
According to reports, he had left a wife and four children behind in Uzbekistan in order to earn money to send home.
After applying for residency in 2014, he was informed in December 2016 that “he had four weeks to leave the country”, police official Jonas Hysing said.
He disappeared and, in February, was officially put on a wanted list.
Responding to the attack, Swedish Justice Minister Morgan Johansson said he wanted to toughen the nation’s terrorism laws.