An M train shutdown will leave commuters in Brooklyn and Queens inconvenienced for months.

Before anticipated tunnel work on the L train can begin, officials told the New York Daily News that renovations on the M train will need to be completed, which will require shutting down a large stretch of stops.

RELATED: Upcoming L train closure could last 18 months

MTA plans called for the M train to be out of service between Metropolitan Avenue and Myrtle Avenue starting in the summer of 2017, during which time the M will be rerouted on the J/Z line, NY1 reported. While different segments will be repaired in different phases, the whole project should last 10 months.

The first phase of the shutdown was planned to rehab a bridge for two months, during which time there will be no M trains between Metropolitan Avenue and Myrtle Avenue, according to the Daily News. During the second phase -- scheduled to last eight months once the bridge is rehabbed -- a shuttle train will carry passengers between Myrtyle-Wyckoff and Metropolitan Avenue.

RELATED: MTA announces new NYC transit president

“This is critical work we need to have done,” MTA Chair Tom Prendergast said to the Daily News. “We recognize the importance of the M and the L to the people of this area.”

Two stations, Knickerbocker and Central Avenue, will be closed for the entire 10-month project, the Daily News added.

The rebuilding of the bridge and viaduct will be done with new material that the MTA said will last longer than the original material, which is outdated compared to today's building standards. Besides implementing newer material, the construction will replace steel girders, track beds and platforms, the MTA added. 

RELATED: Subway riders cautious after recent train slashings

The MTA said that the work must be done so that the M can function at full capacity when it will be needed to take on ridership while the L train’s tunnel is being repaired, according to NY1.