An Arizona man has been sentenced to 15 years in prison for setting fire to a camper trailer that was occupied by a woman who had a court protection order against him.

Yavapai County prosecutors said James Haynes, of Prescott, was originally facing charges of attempted murder, arson, violation of a court order and aggravated harassment after last year’s incident.

WILDFIRE WITH 'ZERO CONTAINMENT' CLOSES IN ON SMALL ARIZONA TOWN

They said Monday that Haynes, 48, entered into a plea agreement and pleaded guilty to charges of arson and criminal damage/domestic violence.

Phoenix, Tucson, Flagstaff news

A Prescott, Arizona, man has been sentenced to 15 years in prison for setting fire to a camper trailer owned by someone with a protective order against him. (Fox News)

Sheriff’s officials said deputies responded to reports that Haynes had violated a civil court order of protection by crashing his car through two gates and into the camper of the unidentified woman around 2:45 a.m. on Oct. 13.

Haynes then lit his vehicle on fire and crawled underneath the trailer trying to reach the woman.

Authorities said the fire started to spread after the camper trailer's propane tanks exploded, but the woman was able to escape to another residence.

CLICK HERE TO GET THE FOX NEWS APP

Haynes was arrested by a SWAT team and taken to a hospital after he told deputies that he had swallowed 25 painkiller pills before the incident.