A New Jersey Transit police officer is being hailed as a hero for pulling a man from the tracks and out of the way of an oncoming train last week.

NJ Transit said in a statement that Officer Victor Ortiz responded heroically when he pulled the man from the tracks at Secaucus Junction on Friday morning, seconds before the arrival of a train.

"Officer Ortiz's selfless and heroic actions demonstrated a level of bravery and a true sense of compassion and purpose that often goes unrecognized but is ever present in our law enforcement community," the agency said.

Ortiz told The Record newspaper he received a report of a disorderly passenger about to exit a train.

The man repeatedly asked why police were called. Ortiz said he asked the man to sit down while he spoke to the conductor, but that he walked down the platform and jumped onto the tracks, saying he didn't want to go to jail.

Ortiz said he checked to see that there were no oncoming trains before following the man, who ran to another set of tracks.

"At that point he's like, 'I just want to die, I just want to die,'" Ortiz told WCBS-TV. "He pretty much went down on his knees and down on his arms. At that point I said, 'You're not going to die, you're not going to die.'"

Ortiz struggled with the man and said he called central communications to stop the oncoming train, but its horn blew.

"I knew at that point the train's not going to stop in time," Ortiz said.

Video showed Ortiz eventually overpowering and dragging the man to safety moments before a train pulls into the station.