A firefighter in upstate New York is facing a felony arson charge after authorities say he set his family’s house on fire and wrote an anti-police message outside as a potential cover-up.

Jason Stokes, 41, pleaded not guilty Tuesday to felony second-degree arson following the mysterious Aug. 10 summer blaze in Endicott, just west of Binghamton, local station TV WBNG reported.

Stokes, his wife and two teenaged children escaped the home safely, state police said.

New York State Police New York firefighter Jason Stokes, 41, has pleaded not guilty to the felony arson charge.

Broome County District Attorney Steve Cornwell described an “obstacle course” inside the house that firefighters had to get through.

“There were gas cans, full gas cans and other containers full with flammable material, placed throughout the home as if it were an obstacle course to get around,” he said at a press conference Tuesday.

Authorities say they found a “Blue Lives Matter” flag outside the home and a spray-painted message on a wall reading: “Lie with pigs, fry like bacon.”

Cornwell called the message, which he refused to repeat, a “despicable display of how law enforcement should be viewed in society today.” He suggested that the message was meant to throw off investigators into believing anti-police protesters were to blame. He declined to speculate on a possible motive.

At the time of the incident, the family suggested that the fire was a targeted attack against them, WBNG reported.

Stokes was released Wednesday on $10,000 bail. An attempt to reach him for comment Thursday was not immediately successful.

The Press & Sun-Bulletin of Binghamton reported that Stokes has worked as a firefighter with the Endicott Fire Department since March 2005. He has been placed on administrative leave following the charges.

A trial date is set for April 17.