STOCKHOLM (AP) — A Swedish appeals court has acquitted a 46-year-old man of preparing an attack in Stockholm on behalf of the Islamic State group.

The Svea Court freed David Idrisson, an Uzbek national who previously had been sentenced to seven years in jail for having gathered some 500 kilograms (1,100 pounds) of chemicals, knives, gas masks and military equipment and for having photos of potentials targets in Stockholm on his phone.

Judge Ragnar Palmkvist said Wednesday there was “not sufficient evidence” against Idrisson and two others that they were planning terrorist offenses. The two other defendants had already been acquitted in the case by a lower court.

The Svea Court upheld guilty verdicts and prison sentences of between four and six months against all three for financing IS by sending up to 20,000 kronor ($2,120) each.