A Midland police officer was shot and killed Tuesday morning when he was mistaken for an intruder while responding to a burglar alarm.

Nathan Heidelberg, 28, had served on the Midland force for five years. (Midland Police Department)

Officer Nathan Heidelberg, 28, was a five-year veteran of the Midland Police Department in West Texas. He died around 8:30 a.m. at a local hospital, CBS 7 reported.

"Nathan treated others with respect, regardless of their demeanor or actions," Police Chief Seth Herman said on Facebook. "He was a tireless public servant who devoted every ounce of energy to this profession, the citizens and his fellow officers. We have lost not only a great officer, but a loving brother and the most positive example of what we should all aspire to be."

David Charles Wilson (MIdland County Sheriff's Office)

CBS 7 reported that Heidelberg was with three other officers early Tuesday at a Midland home, according to an internal email. Though officers announced their presence at the front door, the homeowner thought they were intruders and shot at them, according to CBS 7.

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

Police vehicles escorted Heidelberg's body to the Tarrant County medical examiner's office for an autopsy.

Midland Police Officer Travels to Tarrant County WATCH: First responders are taking part in honoring Officer Heidelberg as he is taken to Tarrant County for an autopsy. Posted by CBS7 News on Tuesday, March 5, 2019

Midland Mayor Jerry Morales asked residents to fly all flags at half-staff in remembrance of Heidelberg and other fallen officers.

"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," Morales said on Facebook. "This is a tragic loss for our community."