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.
In an interview with AFP published on Monday, Mr Johansson specifically mentioned tackling the financing of terrorism and potential prison sentences for those "dedicated to terrorism even if not connected to a specific crime".
"We want to give the police the opportunity, without concrete suspicion of a crime, to go into workplaces to make sure that people who work there are in Sweden [legally]," he added.
The beer company that owned the lorry said it was hijacked while making a delivery to a restaurant.
Eyewitnesses said it sped down Drottninggatan (Queen Street), a central shopping street, and appeared to be deliberately mowing people down.
The vehicle then crashed into the front of the Ahlens department store.
Police later confirmed they discovered a suspect device inside the lorry.
They have not released the identities of those who died, but said they were:
- Two Swedish nationals - one reported to be an 11-year-old girl
- A Briton - named by his family as 41-year-old Chris Bevington
- A Belgian woman, who has since been named by the Belgian media as 31-year-old psychologist Mailys Dereymaeker