STOCKHOLM -- An Uzbek man who rammed a stolen truck into a crowd in downtown Stockholm in April, killing five and injuring 14, was charged Tuesday with terrorism, attempts to carry out a terror act and endangering others.

Rakhmat Akilov is the only suspect and has already confessed. He was arrested hours after he drove a stolen beer truck into a crowd of shoppers on a busy pedestrian shopping street and crashed it into an upscale department store in Stockholm's city centre on April 7. A British man, a Belgian woman and three Swedes were killed.

"Akilov wanted to punish Sweden for taking part in the international coalition against (the Islamic State group)," prosecutor Hans Ihrman told a news conference.

Johan Eriksson, Akilov's defence lawyer, confirmed that was his client's motive. He said Akilov admits committing terror and exposing people to attempted murder, and has been co-operative during the investigation.

Ihrman said he would demand that Akilov gets a life sentence and be extradited from Sweden. The trial is scheduled to start Feb. 13 and last until May. 9.

"My aim is that Akilov should never be allowed to move freely in our society," he said. "I hope and believe that a trial will give us more answers to what happened. And why. These answers are important for our open society."

According to the charges obtained by The Associated Press, prosecutors say Akilov had offered to the Islamic State group that he would carry out an attack in Stockholm on behalf of the group, and had gathered information about possible targets. It was not clear whether the group had accepted his offer.

Investigators found on Akilov's cellphone pictures he had taken of streets in downtown Stockholm "which strengthens (the theory) he was on reconnaissance of the crime scene," according to the 35-page document.

They also found internet chat logs in which Akilov discussed becoming a martyr and swore allegiance to IS between Jan. 12, 2017, and the attack on April 7, as well as a memory card with "material that can be connected to IS," including execution videos.

Sweden's domestic intelligence agency SAPO said it failed to identify others who were encrypted in the chat logs. Ihrman said it was "unclear" when and how Akilov had been radicalized.

Akilov also caused an explosion inside the truck he had stolen when a suspected bomb made of five gas canisters with dozens of screws, blades and smaller metal objects exploded. The blast caused "extensive damage to the vehicle," according to the charges.

Christer Nilsson, head investigator at Sweden's National Operations Department, said the police theory was that Akilov planned to blow himself up with the home-made explosive device "but that failed."

Swedish officials had been seeking Uzilov, a construction worker who was 39 at the time, for deportation from the country ahead of the attack because his asylum application had been rejected.

Akilov had been ordered to leave Sweden in December 2016. Instead, he allegedly went underground, eluding authorities' attempts to track him down.

He had been on the authorities' radar previously, but police dismissed him as being of marginal interest and said there was nothing to suggest he might plan an attack.

The April attack shocked Swedes, who pride themselves on their open-door policies toward migrants and refugees.

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.

Officials have acknowledged the difficulty of keeping tabs on asylum-seekers who have been ordered to leave the country after their applications were turned down.

------

Jan M. Olsen in Copenhagen, Denmark, contributed to this report.