A man working on a roof in a suburb of Tampa, Florida, was shot and killed Wednesday after another construction worker accidentally fired his gun while exiting a truck, officials said.

Major Frank Losat speaks to the press regarding a shooting incident which left one roof worker dead in Hillsborough County, Florida, on may 9, 2019. WFLA

A 44-year-old man was found in critical condition by authorities on top of a roof in Riverview, said Major Frank Losat with the Hillsborough County Sheriff's Office. He was lowered from the roof by the fire department and taken to a local hospital where he later died.

Authorities did not release the name of the victim or the shooter.

The man who fired the gun, described as a longtime friend of the victim, Losat said.

"The person who fired the shot was getting actually out of his truck, slipped on a piece of construction debris at this point," Losat said. "He was transitioning the gun from his waistband, his pocket, and at some point the gun is fired unintentionally."

Losat said the shooter was fully cooperating with authorities. The sheriff's department is still investigating and could not say whether they would file charges.