BERLIN (AP) — A German man has been convicted on terrorism charges and given a four years and three months prison sentence for being a member of a group that advocates attacks on Western forces in Afghanistan and for training in the use of weapons and explosives.

A Berlin state court ruled Thursday that the suspect was a member of the so-called German Taliban Mujahideen. A court statement, which identified the 27-year-old only as Thomas U. in keeping with German privacy rules, said he was convicted of membership in a terrorist organization and preparing a serious act of violence abroad. It did not elaborate.

The court says he also glorified jihad, or holy war, in two Internet messages and confessed to the charges against him during his trial.

The verdict can be appealed.