Three branches of the Long Island Rail Road were operating on or close to schedule Wednesday after more than a dozen trains were delayed in both directions because of switch trouble near Mineola.

The LIRR said the switch problem was reported at 8:20 a.m. and repaired at 9:10 a.m. It affected trains on the Oyster Bay, Ronkonkoma and Port Jefferson/Huntington branches, according to Marjorie Anders, a spokeswoman for the commuter rail service.

The longest delay, 42 minutes, was the 8:55 a.m. train from Huntington to Penn Station.

Anders said at about 10 a.m. the Oyster Bay branch was operating on or close to schedule, but that residual delays likely would continue on the other two branches through midmorning.

advertisement | advertise on newsday

At 11:01 a.m., the LIRR sent an email alert announcing trains on all three branches were operating on or close to schedule.

The switch problem was first announced in an email alert shortly before 9 a.m.