A 39-year-old old Uzbek man confessed Tuesday to ramming a stolen truck into a crowd in Stockholm, killing four people and wounding 15, his lawyer said.

The Stockholm District Court ruled that police could detain Rakhmat Akilov for a month after he admitted in court that he drove the stolen beer truck into a crowd outside an upscale department store in central Stockholm on Friday afternoon. He was detained by police hours later and arrested early Saturday.

STOCKHOLM TERROR: SWEDEN WILL 'NEVER GO BACK' TO MASS IMMIGRATION, PM REACTS

Police have not given a motive for the attack and no extremist group has claimed responsibility. Police said Akilov was known to have been sympathetic to extremist organizations but that there was nothing to indicate he might plan an attack. His Swedish residency application was rejected last year.

After the court hearing, Akilov's lawyer, Johan Eriksson, said Akilov is "pleading guilty" to Friday's attack but said he was not allowed to say more about the case.

The four people killed were two Swedes, a Belgian woman and a British man. The British government has identified the Briton as Chris Bevington, an executive at Swedish music-streaming service Spotify. The others have not been publicly identified.

Eight of those injured, two seriously, were still being treated in the hospital.

SWEDEN MOURNS 4 KILLED, 15 WOUNDED IN STOCKHOLM TRUCK ATTACK

The prosecutor's office said Tuesday that it will revoke the arrest of a second man police had detained Sunday because they suspected he was involved in the case.

According to the prosecutor, "the suspicions have weakened" against him, and there were no grounds to apply for a detention order.

The statement said he would not be set free but instead "be taken into custody due to a previous decision that he shall be expelled from Sweden." It gave no more details.

Friday's attack shocked Swedes who pride themselves on their open-door policies toward migrants and refugees, and many expressed fears that something had gone badly wrong.

In 2015, a record 163,000 asylum-seekers arrived in the country — the highest per capita rate in Europe. The government responded by tightening border controls and curtailing some immigrant rights.