ZURICH — A former Swiss soldier who commanded a Christian militia fighting the Islamic State in Syria has been found guilty of violating Swiss neutrality.

The case of the former soldier, Hanna Johannes Cosar, is a rare example of European countries prosecuting citizens for fighting against, rather than with, jihadist forces in Iraq and Syria.

Mr. Cosar was convicted on Friday of breaching Switzerland’s ban on fighting for another country without first obtaining permission from the government. He was fined 500 Swiss francs, or about $500, a relatively lenient punishment.

A former sergeant in the Swiss Army, whose family had moved to Switzerland from Syria three generations ago, Mr. Cosar was accused of joining a private army — the Syriac Military Council — whose aim was to defend Syriacs, one of the world’s oldest Christian communities, against Islamic State forces.