BERLIN (Reuters) - A German court has found a Syrian refugee guilty of attempting to defraud Islamic State, a court spokeswoman said on Monday, granting legal protection to a group viewed as terrorists by the European Union.

A judge in the district court in the southwestern city of Saarbruecken sentenced the 39-year old hairdresser from Damascus to two years in prison for trying to get Islamic State operatives to transfer him up to 180,000 euros ($212,400.00).

The judge ruled that the man used the false pretence that he would carry out attacks in Germany for Islamic State using explosives. The money was never transferred to the man.

The court rejected the prosecution’s argument that the man was guilty of the more serious crime of planning to carry out attacks on behalf of the militant organization.

Both parties have appealed the ruling to the Federal Supreme Court, the court spokeswoman said. The Syrian refugee was named only as Hasan A. due to German privacy laws.