Service was restored in both directions on the Ronkonkoma Branch Thursday morning after a man was fatally struck by a train west of the Farmingdale station, the Long Island Rail Road said.

Salvatore Arena, spokesman for the LIRR, said the man, 54, has been identified as being from Farmingdale and was struck shortly before 6:30 a.m.

The engineer told police he spotted a trespasser as the train rounded a bend and that he could not stop in time, Arena said.

The man made no effort to get out of the way, the spokesman said, adding that the case is being investigated.

Service between Ronkonkoma and Hicksville was suspended, but the branch was operating on or close to schedule by about 9:45 a.m., the LIRR said.

Commuters experienced delays up to 90 minutes.

With Ellen Yan