A second suspect has been formally placed under arrest in connection with a truck attack that killed four people and injured 15 in Stockholm, a district court said on Sunday.

“I can confirm that a second person has been arrested,” Stockholm district court judge Helga Hullman told AFP.

Meanwhile, Swedish Police on Sunday said the a 39-year-old man from Uzbekistan, the first one to be arrested in the case, had shown interest in extremist groups and had his permanent residency application rejected in June 2016.

“We know that he showed interest for extremist organisations like IS,” police chief Jonas Hysing told reporters, adding that two Swedes, one Briton and a Belgian were killed in the attack.

The suspect “applied for a permanent residency permit in 2014,” Mr. Hysing said.

“The Migration Agency rejected it in June 2016 and also decided that he was to be expelled,” he added.

“In December 2016, he was informed by the Migration Agency that he had four weeks to leave the country. In February 2017, the case was handed over to the police to carry out the order, since the person had gone underground,” he said.

But police apparently never found the man.

On Friday, the man from Uzbekistan is alleged to have barrelled a stolen beer truck several hundred metres down the bustling pedestrian street Drottninggatan in the heart of Stockholm.

The vehicle mowed down shoppers before slamming into the facade of the busy Ahlens department store.

The motive for the attack is not known.

Thousands of people were to gather in central Stockholm on Sunday for a “Lovefest” vigil against terrorism.