A westbound train struck a man Tuesday night on the LIRR tracks in Riverhead, authorities said.

The man, 50, was lying on the tracks in an apparent suicide attempt, and his foot was amputated by the train, according to an MTA source. He was airlifted to Stony Brook University Hospital, where doctors hope to reattach his foot, the source said.

advertisement | advertise on newsday

He was hit about 10:30 p.m. by the Long Island Rail Road’s 9:39 p.m. westbound train on the Ronkonkoma line, authorities said.

The train was held just east of Riverhead, the LIRR tweeted. The train resumed service by 12:10 a.m. Wednesday.