Hundreds of people were evacuated from a 24-story building in midtown Manhattan Thursday after a gas odor was detected in the area, fire officials said. Nearby streets were also cleared.

Con Edison was working to locate the source of the potential leak and had successfully shut two valves in the building at 498 Seventh Ave., the FDNY said. Twelve units were called to the scene.

The call of a possible gas leak came in a few minutes before 4 p.m.

Images from the scene showed traffic on Seventh Avenue backed up as FDNY trucks blocked lanes.