Sheriff John Hunt fought back tears while saying goodbye to his longtime friend, William Petry, one of three law enforcement officers killed in an ambush while serving a warrant in eastern Kentucky last week.

The small Appalachian county that Hunt is in charge of protecting is reeling from the deaths of the officers, who walked into a hail of bullets from a gunman holed up in his home Thursday evening. Petry, a veteran officer who joined the Floyd County sheriff’s office after retiring from the state police a few years ago, was honored Tuesday during an emotional funeral service.

"William loved law enforcement. He loved the job. He loved the people," Hunt said in a eulogy for his longtime friend Tuesday morning. "He is a hero ... and I know he will never be forgotten."

PARDONED KENTUCKY KILLER SENTENCED TO 42 YEARS IN PRISON

The shooting is likely Kentucky's deadliest incident for law enforcement in nearly 100 years. Petry and Prestonsburg police Capt. Ralph Frasure, both 60 years old, died at the scene and Prestonsburg Officer Jacob Chaffins, 28, died in a hospital Friday night. A police dog was also fatally shot.

The man arrested for their deaths, 49-year-old Lance Storz, was taken into custody in the small community of Allen after family members helped police secure his surrender Thursday night.

Dozens of uniformed law enforcement officers gathered Tuesday at the funeral at Prestonsburg’s Mountain Arts Center. Petry's family gave permission for media to livestream the event on local news stations. Frasure, Chaffins and the police dog, Drago, will be laid to rest after funeral services later this week.

Chaffins, who joined the department in 2019, left behind a wife and young daughter. He also served on the Prestonsburg Fire Deparment and was a member of the National Guard. Frasure had been married for more than 40 years and had four grandchildren. He had been an officer with Prestonsburg Police since 1983.

Lexington, Bowling Green, Louisville crime

Three Kentucky police officers were killed by Lance Storz in an ambush shooting last week. (Fox News)

Frasure's daughter wrote in a Facebook post Friday that her father "was a great man who loved his family like no other."

KENTUCKY BILL WOULD MAKE IT A CRIME TO INSULT POLICE OFFICERS

"An evil evil man took my daddies life today," Stacy Frasure McGuire wrote. "I know I should forgive but how do I do that?"

Floyd County Deputy Kevin Thacker said he took a phone call from Petry last week, a typical issue about a towed car, he said. But at the end of the call, as had become ritual, Petry told him he loved him.

"That was his last words to me," Thacker said at the funeral. "And I'll never forget that."

Police went to the house in Allen on Thursday after a family member called to say Storz's wife was being held in the home against her will and was being abused, Hunt said in a news conference over the weekend. The wife was waiting for them when they arrived, telling the officers Storz was asleep, so she was able to get outside. Four officers, including Petry, returned to serve a protective order against Storz, Hunt said. Storz watched them approach from a window and began shooting, Hunt said.

The officers' deaths were the most in a single incident since a 1923 prison riot in Eddyville that left three corrections officers dead, Prestonsburg Police Deputy Chief Ross Shurtleff said Sunday. Storz is facing three counts of murder of a police officer and is being held in jail on a $10 million cash bond.

Petry's death will be a huge loss for the department, Hunt said, because he worked so well with younger, inexperienced officers who revered his experience and calm.

KENTUCKY DISABLED MARINE CORPS VET'S BRUTAL BEATING: 2 CAUGHT AND CONVICTED, 3RD SOUGHT, AUTHORITIES SAY

The young officers "respected him like nobody I’ve ever seen in such a short time," Hunt said.

Four other officers were injured in the shooting, though none wounds were life-threatening, state police said over the weekend. One civilian was also hurt in the shooting, state police said.