COLUMBIA, S.C. (AP) — The man who recently killed a police officer in South Carolina responding to a domestic violence call tracked the officer from upstairs in his home with a rifle before firing the fatal shot, authorities said Tuesday.

Then as other officers tried to drag Cayce Police Officer Drew Barr to a patrol car early Sunday morning so he could get medical help, the man fired a second shot at them, Cayce Police Chief Chris Cowen said.

“He was calculated in what he did. He murdered our officer,” Cowen said.

The shooter, 36-year-old Austin Leigh Henderson, then put his wife and daughter into a closet and held them hostage and police at bay for about seven hours before killing himself with a gunshot to the head, authorities said.

Cayce officers were called to Henderson’s home about 2:45 a.m. Sunday after a woman sounding distressed called 911 on her Apple Watch and said she was being attacked by a man with a rifle, Cowen said,

The first officer on the scene handcuffed a man in the yard who had been partying with Henderson all day. Barr was the second officer at the scene and was shot shortly after arriving, the police chief said.