After a morning of delays and cancellations because of two broken rails, the Long Island Rail Road said it was operating on or close to schedule Tuesday in both directions through New Hyde Park, the railroad said about 12:30 p.m.

At one point during the morning commute, delays averaged up to 60 minutes because of broken rails, first near the Farmingdale station and then near the New Hyde Park station, the LIRR said.

Ronkonkoma Branch service was restored with residual delays averaging 35 minutes in both directions just before 1 p.m. Earlier, service was suspended due to a broken rail east of Farmingdale Station, the LIRR said.

Temporary repairs were made on the broken rail near Farmingdale during the morning rush hour, and crews then went back later to make permanent repairs, spokeswoman Meredith Daniels said.

Buses were in place to accommodate customers during the service suspension on the Ronkonkoma line, the LIRR said.

Daniels said the rail near New Hyde Park was fixed at about 11 a.m. and that crews were expected to complete repairs to the rail near Farmingdale sometime in the early afternoon.

advertisement | advertise on newsday

She also said a third broken rail is being worked on in Brooklyn, at the East New York station.

The morning delays were mostly on three lines — Ronkonkoma, Port Jefferson and Oyster Bay — the LIRR said.

The delays originally were announced on social media shortly after 7:30 a.m. and affected the Ronkonkoma, Port Jefferson and Oyster Bay branches.

The original delays were averaging 15 to 20 minutes; the LIRR then said about 8:15 a.m. that the delays had been extended to 45 minutes.

Earlier, service on the Ronkonkoma Branch was suspended in both directions between Ronkonkoma and Farmingdale because of the broken rail near Farmingdale. Ronkonkoma service was restored about 6:45 a.m., but the LIRR said customers should anticipate delays and congestion because of the broken rail.