A broken rail on the 7 train line caused a hellish commute for city straphangers Monday morning.

The train trouble started around 7 a.m. when a broken rail near Queensboro Plaza temporarily wiped out 7 train service between Queens and Manhattan in both directions, the MTA said.

Trains on the line then ran only into Manhattan from Vernon Boulevard-Jackson Avenue, Hunters Point Avenue and Court Square while MTA crews worked to repair the busted rail.

The issue caused extensive delays on the E, M, F and R lines.

Shortly after 9 a.m., the MTA said in a tweet the rail was repaired and 7 trains were “beginning to run their entire route through Queensboro Plaza.”

“Continue to expect considerable delays in both directions as we get trains back on schedule,” the tweet read.

The Long Island Rail Road allowed MetroCard holders to board trains at no additional charge at Flushing-Main Street, 61 Street-Woodside and Penn Station.

Meanwhile, riders on the 7 train took to Twitter to air their frustrations over the chaos.

“Nothing like starting Monday with the 7 train suspended and every other train out of Queens packed like sardines,” Emmy Potter tweeted. “I love to be regularly late to work because of crumbling infrastructure problems!!!! #MTA.”

Another Twitter user wrote: “It’s not a Monday morning in New York unless there’s significant delays on the 7 train.”