L train riders are already dreading major repairs coming to their line. But first, the pain will be felt along the M, which gets set to undergo big repairs tied to those along the L. NY1's Transit Reporter Jose Martinez explains.

L always comes before M — but not when it comes to major repairs looming for riders on both lines.

Starting in summer 2017, seven stations at the tail end of the M in Brooklyn and Queens will be closed for months at a time as the MTA rebuilds two deteriorating sections of the line.

"I think going to be really bad for commuters that travel every day into the city and back, and it's going to be really inconvenient," one man said.

That means at least two months of no service between the Myrtle Avenue station and the Middle Village-Metropolitan Avenue stop as repairs are made to a bridge between the two stations.

"I'll have to take a bus, two buses," one woman said.

The MTA says it is crucial work that has to be completed before another massive repair job begins in the L train's East River Tunnel, an outage which would shift many of that line's riders onto the M.

"We want to make sure there are viable alternatives and safe alternatives for our customers when they have to rely on other lines when we do shut down the L — the M line being one of them," MTA spokesperson Kevin Ortiz said.

The second phase of work along the M — set to last at least eight months — is slated to rebuild a century-old structure between the Myrtle and Central Avenue stations. M trains are planned to be rerouted onto a portion of the J and Z tracks, with shuttle buses also in the mix.

"It's important work that needs to be done," Ortiz said. "You know, for the past couple of years, we've essentially put Band-Aids on the situation, and now we really have to get in there and make more of a permanent fix."

The work comes at a crucial time for the M, a once-sleepy line that now serves more than 60,000 riders every weekday.

At the seven stations affected by the work, ridership has grown by more than 50 percent since 2000.

The ridership pales in comparison to that of the L, which carries close to 300,000 riders on weekdays. Its tube linking Manhattan and Brooklyn was damaged by millions of gallons of salt water during Hurricane Sandy.

But before that big job, another one awaits.