Service resumed with delays on the N and Q lines between Queens and Manhattan Tuesday night after a defective rail disrupted commutes for thousands of people in the middle of rush hour, the MTA said.

A track geometry car that uses ultrasonic technology discovered the broken rail in the afternoon south of the Queensboro Plaza station, and service was disrupted shortly before 2:40 p.m.

Riders heading between Manhattan and Queens should take the 7 train, and transfer to a shuttle service at Queensboro Plaza. There are also no downtown N and Q trains at Lexington-59th Street or Fifth Avenue, and straphangers should squeeze onto the No. 4, 5, and 6, the MTA said.

Manhattan-bound R trains are also now running on the F line between 36th Street in Queens, and West Fourth Street in Manhattan. R trains are also running express in Brooklyn to 59th Street-Fourth Avenue, while the N train is running local.