A civilian NYPD employee died in a freak accident Wednesday when a tire flew off a private sanitation truck and slammed into his car, police said.

Robert Martinez, 64, of Staten Island, was driving his 2003 Chevy Tracker in the eastbound lanes of the Gowanus Expressway near Seventh Avenue in Brooklyn at about 6:30 a.m. as a 2009 Mack garbage truck operated by Century Waste Services was traveling in the opposite direction.

The truck’s rear passenger-side wheel flew off over the center median and through Martinez’s windshield, striking him in the head, cops said.

At the time, Martinez was traveling to Police Headquarters in lower Manhattan, where he worked as a steamfitter, sources told the Post.

He was rushed to NYU Langone Hospital-Brooklyn, where he was pronounced dead.

“This is a bad time and the family is not making any statements at this time,” said a woman who answered the door at Martinez’s Cranford Avenue home.

The 46-year-old driver of the truck and a 27-year-old passenger remained at the scene after the crash, and neither has been charged, the sources said.

“I saw the guy on the side of the road. He was having a fit,” a witness said of one of the men on the truck.

“He was sitting on the grass, holding his head. He was ­crying.”

Century Waste Services has a spotty safety record, according to inspection data from the Federal Motor Carrier Safety Administration.

Since 2016, the feds have conducted 21 inspections on the Elizabeth, NJ, company’s 34-vehicle fleet.

A staggering 65 percent of those inspections resulted in the feds yanking a vehicle off the streets until it could be made safe — more than three times the national average of 20.7 percent, data show.

The company has been cited 74 times since 2016 for a litany of safety concerns including “failure to secure load,” letting tires get too worn down, and failing to maintain braking systems.

In February, inspectors ­issued a violation for “loose and/or missing” wheel fasteners.

“Our hearts go out to the family of the victim. this event was an unfortunate accident,” said Ara Chekmayan, a spokesman for Century Waste.

“We are fully cooperating with the investigation of this tragic event.”

The private garbage-hauling industry has come under scrutiny lately following recent tragedies.

In April, a truck driven by Bronx-based Sanitation Salvage Corp. driver Sean Spence fatally struck an elderly man. A subsequent investigation revealed Spence had lied about hitting and killing a co-worker last November.

Last year, a driver with private hauler Action Carting killed 27-year-old Neftaly Ramirez, who was pedaling a bicycle in Brooklyn.

Additional reporting by Max Jaeger