Police arrested Stephane Poussier at his home in Dives-sur-Mer, northwest France, on Sunday after he sent two tweets welcoming the death of Lieutenant-Colonel Arnaud Beltrame.
"Whenever a policeman is shot... I think of my friend Remi Fraisse," Poussier said on Twitter, referring to an environmental 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.
Beltrame was shot and stabbed to death after offering himself in exchange for a woman being used as a human shield by Radouane Lakdim who had already killed three other people in a rampage on Friday.
A national tribute is to be held for Beltrame, who President Emmanuel Macron said had "died a hero".
Poussier's remarks provoked strong reactions and his Twitter account was disabled.
He could face up to seven years in prison and a fine of 100,000 euros ($124,000).
Poussier stood unsuccessfully in elections last year as a candidate for the La France Insoumise (France Unbowed) party of radical leftwinger Jean-Luc Melenchon.
His comments were condemned by the party and Melenchon, who said on Twitter that it would on Monday file a complaint against him for justifying terrorism.
(This story has not been edited by NDTV staff and is auto-generated from a syndicated feed.)
Get Breaking news, live coverage, and Latest News from India and around the world on NDTV.com. Catch all the Live TV action on NDTV 24x7 and NDTV India. Like us on Facebook or follow us on Twitter and Instagram for latest news and live news updates.