A Texas police officer was responding to a burglar alarm when the homeowner mistook him for an intruder and fatally shot him on Tuesday morning, reports said.

The Midland police officer identified as Nathan Heidelberg, 28, died around 8:30 a.m. at a local hospital, Midland's KOSA-TV reported.

The homeowner, identified as David Charles Wilson, was arrested Tuesday and charged with manslaughter before being released on bond, the Midland Reporter-Telegram reported.

David Charles Wilson was arrested Tuesday and charged with manslaughter before being released on bond, reports said.

David Charles Wilson was arrested Tuesday and charged with manslaughter before being released on bond, reports said. (Midland County Sheriff's Office)

OFFICERS KILLED IN THE LINE OF DUTY IN 2018

Wilson's attorney Brian Carney told the paper that his client believed that his family was experiencing a home invasion and "only fired his weapon to protect his family."

“We would like to express our deepest sympathies to Officer Heidelberg’s family and the Midland Police Department for the events that led to his death,” Carney said.

Heidelberg is a five-year veteran of the Midland Police Department.

CLICK HERE TO GET THE FOX NEWS APP

"I'm asking our community to come together today and this week to lift our fallen police officer, Officer Heidelberg, his family and the Midland Police Department family in prayer," Midland Mayor Jerry Morales said on Facebook. "This is a tragic loss for our community."