A court in Austria has sentenced a 17-year-old boy to 2 ½ years in prison for joining the Islamic State group.

The Vienna regional court found Oliver N. guilty Wednesday of participating in a terror organization and incitement to terrorism.

The boy, whose full name wasn't released in line with Austrian privacy rules, had traveled to Syria last year and claimed to have worked as an ambulance driver collecting wounded IS fighters.

Prosecutors said he also spread IS propaganda videos online.

Presiding judge Alexandra Skrdla said there was insufficient evidence to prove that the boy had actively taken part in combat.

The boy's lawyer, Wolfgang Blaschitz, said his client had turned his back on jihadist ideology since returning to Austria this spring.