Tuesday’s evening commute on the Long Island Rail Road was marred by 30-minute delays and cancellations mainly due to a disabled train at Penn Station, officials said.

LIRR officials said systemwide service out of Penn Station was delayed at about 5 p.m. but was on or close to schedule by 7:30 p.m.

Just after 11:30 p.m., most LIRR lines were operating on schedule with delays continuing on the Far Rockaway and Port Jefferson lines.

The railroad attributed the delay affecting riders headed to Hempstead from Penn Station to “an earlier disabled train at Penn and the resulting shortage of equipment.”

The delay led to brief overcrowding at Penn Station as commuters waited for LIRR workers to fix the problem.

advertisement | advertise on newsday

A 7:27 p.m. train from Babylon that was scheduled to arrive in Speonk at 8:27 p.m. was 38 minutes late “after being held to accommodate a late-arriving connection,” officials said.

Penn Station’s difficulties were not the only problem Tuesday.

A Far Rockaway train from the Atlantic Terminal was 18 minutes late “due to earlier police activity at Gibson,” the LIRR tweeted Tuesday night.