A Kentucky State Police trooper died while off duty Monday when he fell from the roof of a barn he was repairing, authorities said.

Trooper Mason A. Flynn fell about 22 feet and hit his head, Pulaski County Coroner Clyde Strunk said.

“The agency is heartbroken … over the loss of this young trooper,” said Lt. Michael Webb, a spokesman for KSP headquarters in Frankfort.

In another tragic twist, Flynn became the third member of his state police cadet class to die in less than two years since graduation. Two of his classmates — Troopers Eric K. Chrisman and Joseph Cameron Ponder — were killed in the line of duty last year.

Chrisman, who was 23, died in a traffic crash while responding to a reckless driving complaint. Ponder, who was 31, was fatally shot during a traffic stop. Both were stationed in western Kentucky.

Flynn, 24, was pronounced dead Monday at the scene in southern Kentucky.

“It was a tragic accident,” Strunk said. “He was putting a metal roof on a hay barn and a piece of tin slipped.”

Strunk’s office is conducting the death investigation.

Flynn was in his second year as a state police trooper, and his sudden death hit his colleagues hard, said Trooper Lloyd Cochran, a spokesman for the London state police post.

Flynn was assigned to the KSP post in Pikeville after graduating from the state police academy in January 2015. He transferred to the London post last February and was assigned to patrol duties in Rockcastle County.

“He’s going to be greatly missed,” Cochran said. “He was a great trooper, a good husband.

“When you talked to him, every time you’d end the conversation, he’d say, ‘God bless you,'” Cochran said. “He was just a really good guy; a good-natured fellow.”

Flynn, who lived in Pulaski County, was working with a friend when he fell, Strunk said.

His body was taken to Frankfort for an autopsy, the coroner said.

Funeral arrangements are pending, Webb said.