The Uzbek man who rammed a stolen truck into a pedestrian in downtown Stockholm last spring -- an attack that killed five and injured 14 -- was officially charged Tuesday with terrorism.

Rakhmat Akilov was arrested several hours after he drove a stolen beer truck into a crowd of shoppers on a busy pedestrian street on April 7. A British man, a Belgian woman and three Swedes were killed.

Akilov is only suspect and has already confessed, authorities said. On Tuesday, he was charged with terrorism, attempts to carry out a terror attack and causing others to be endangered.

“Akilov wanted to punish Sweden for taking part in the international coalition against [ISIS],” prosecutor Hans Ihrman told reporters. Ihrman said he will seek a life sentence.

“My aim is that Akilov should never be allowed to move freely in our society,” he added. “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.”

The trial is scheduled to start Feb. 13 and last until May. 9.

According to prosecutors, Akilov had offered to carry out an attack in Stockholm on behalf of ISIS. It was not clear whether the group had accepted his offer.

However, early reports suggested Akilov posted videos of the terror group’s atrocities on Facebook and “liked” a picture showing the bloody aftermath of the 2013 Boston Marathon bombings.

Investigators found Internet chat logs in which Akilov discussed becoming a martyr and swore allegiance to ISIS between Jan. 12, 2017 and the attack on April 7, court documents revealed. Additionally, investigators found a memory card with “material that can be connected to [ISIS],” including execution videos.

Christer Nilsson, head investigator at Sweden's National Operations Department said the police theory was that Akilov planned to blow himself up with a homemade 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 authorities' radar previously, but police dismissed him as being of marginal interest and said there was nothing to suggest he might plan an attack.

A trial date has not been set.

The Associated Press contributed to this report.