DURHAM — Durham’s police chief says a teenager who died while inside a patrol car shot himself in the head.

Chief Jose L. Lopez Jr. issued a statement Wednesday saying 17-year-old Jesus Huerta was found slumped over in the back seat of the patrol car on Nov, 19 after the officer driving the car heard what he thought was a gunshot.

Lopez said while the medical examiner has confirmed that Huerta died from a gunshot wound to the head, it’s not known if the wound was intentional or accidental.

Authorities said Huerta had an outstanding warrant for his arrest for second-degree trespassing. An investigation showed the officer handcuffed, searched and detained Huerta in the back seat of his patrol car and was taking him to police headquarters to get the warrant.