A man was killed while trying to ride atop a subway car in the Bronx, police said.

The victim, believed to be in his 40s, was found dead at the Elder Avenue Station on the 6-train line around 10:35 p.m., Wednesday, officials said.

Investigators believe the man was a subway surfer who was struck by an overhead barrier before the train pulled into the aboveground station at Elder and Westchester avenues.

The victim’s name has not yet been released.