Straphangers on the J and M lines had a tough commute on Wednesday morning.

Due to a switch problem at Myrtle Avenue, the J line was temporarily suspended both ways between Broadway Junction and Marcy Avenue, the MTA said.

Service was also temporarily suspended on the M line between Middle Village-Metropolitan Avenue and Essex Street in both directions, according to the MTA.

Both lines were restored around 7:25 a.m., but the MTA warned of extensive delays. Those delays have since diminshed and service is running on or close to schedule, the MTA said.