Rakhmat Akilov, main suspect in the Stockholm truck attack that killed four people, has confessed to deliberately driving the stolen vehicle into crowds in the Swedish capital, his lawyer said.

During a court hearing here on Tuesday, the 39-year-old Uzbek admitted to committing a “terrorist crime” last week in which 15 people were also injured, the BBC reported.

Johan Eriksson, defending Akilov, told the court: “His position is that he admits to a terrorist crime and accepts. Therefore, he will be detained.”

Akilov was brought into the heavily guarded court in handcuffs.

He was also known to security services.

Akilov, who was denied residency in Sweden, had expressed sympathy for the Islamic State (IS) group, the police said.

The truck driven by Akilov crashed into the front of Ahlens department store on Drottninggatan (Queen Street), one of the city’s main pedestrian thoroughfares.

He reportedly ran from the scene of the attack on last Friday, still covered in blood and glass, and was arrested hours later in a northern suburb of the city, the BBC reported.

According to reports, he had left his 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.

Two Swedes, one Belgian and a Briton were the victims of the last Friday attack.

Nine people remained hospitalised, two of them in serious condition.