A Hudson Valley man admitted that he ended a gunpoint standoff with police by setting his motel room on fire.

On Friday in Ulster County Court, 37-year-old Dennis Stokes of Hurley pleaded guilty to arson, stemming from a fire at the Super 8 Motel in Kingston.

On Jan. 2, police were alerted about a man with a gun in room 241 at the Super 8.

Stokes refused to allow responding police to enter the room and told officers he was going to “come out blazing” and kill others with him, police say.

Stokes threatened police with an apparent handgun which was later determined to be a realistic looking BB gun. The standoff lasted several hours while officers took positions of safety on the ground and on nearby buildings and attempted to negotiate with Stokes.

Several times during negations, Stokes pointed the gun out of the window at officers. At one point, he opened his motel room door and pointed the gun at an officer who was outside the room, officials say.

Shortly before 5:00 p.m., Stokes sprayed lighter fluid in the room and used a lighter to ignite the fluid. The smoke and flames caused Stokes to jump from the second story window of the Super 8 onto the ground, where he was arrested.

“It is amazing that this defendant was not shot and killed based on his reckless and dangerous actions,” Ulster County District Attorney Holley Carnright said.

Stokes will be sentenced on Dec. 20.

Here are this week's Top 5 news stories from the Hudson Valley

More From WRRV-WRRB