A Pennsylvania man was recovering in a hospital under police guard Sunday after he was charged with homicide in the shooting death of a cop overnight, authorities said.

St. Clair Township police officer Lloyd Reed. Westmoreland County, Pennsylvania, Sheriff's Office

Ray Shetler Jr., 31, of New Florence, shot St. Clair Township police Officer Lloyd Reed, 54, about midnight during a confrontation late Saturday in Westmoreland County, Pennsylvania State Police said. He was pronounced dead of his wounds about midnight at Conemaugh Memorial Medical Center in Johnstown.

Police said Shetler, who was free on probation in connection with convictions for conspiracy and assault, evaded local, county and state officers for several hours before he was arrested without incident about 3:15 a.m. ET near the town of New Florence.

Ray Shetler Jr. faces a homicide charge in the shooting death of a Pennsylvania police officer. Westmoreland County, Pennsylvania, Sheriff's Office

Reed, a 25-year police officer who'd been working part-time for the St. Clair department for more than five years, was investigating a report of a domestic dispute at a home in New Florence, authorities said. The house was on fire and Reed was found lying in the yard when reinforcements arrived, they said

Shetler was being treated at a hospital under police guard for an unspecified injury Sunday. Pennsylvania Gov. Tom Wolf ordered flags dropped to half-staff on all state buildings.

"This is very tough. Unfortunately. this has become a nationwide trend, and it's hit close to home," Westmoreland County Sheriff Jonathan Held told NBC station WPXI of Pittsburgh.

"He was very dedicated, just your average Joe kind of guy, very down to Earth and hardworking," Held said.