Former French parliamentary candidate Stephane Poussier was given a one-year suspended sentence on Tuesday after he posted a tweet on his Twitter account allegedly welcomed the death of a gendarme killed last week in a terrorist attack.

Placed in police custody on Sunday, the left-wing politician appeared earlier in the day before the criminal court in Lisieux, northwestern France, on charges of justifying acts of terrorism.

Poussier was arrested on Sunday after he posted two tweets welcoming the death of an officer in last week’s assault in southern France.

“Whenever a policeman is shot…I think of my friend Remi Fraisse,” Poussier wrote, referring to a Green activist killed by a stun grenade fired by police during a 2014 protest over a dam.

“And this time it was a colonel, great! Additionally, it means one less Macron voter,” he added.

On Friday, a gendarme was fatally injured after he voluntarily swapped himself for a hostage during an Islamist terrorist attack on a supermarket in the southern French city of Trebes.

Two other people were killed and 15 others were wounded in the assault claimed by the Islamic State (IS).

Poussier was a member of the hard-left France Unbowed party before being expelled due to his tweets.