A fire broke out on elevated subway tracks during evening rush hour Wednesday, forcing thousands of people to evacuate, filling a platform with smoke and slightly injuring dozens of people.

Between 3,000 and 4,000 people were evacuated from two trains in Brooklyn, the fire department said. Fifteen people, including three firefighters, suffered minor injuries including smoke inhalation.

During the evacuation, power to the tracks was shut off so riders could walk safely from the trains to the subway platform, the fire department said.

Most of the injured were taken to a hospital after the smoke was reported around 6 p.m. at the DeKalb Avenue stop on the B line, which runs between Brooklyn and the Bronx and passes through Manhattan.

New York City Transit said it believed there was a fire just beyond the platform on a wooden tie. It didn't cite a cause.

Service was affected on parts of five subway lines, complicating the commute for countless New Yorkers.

Passenger Danilo Ignacio said that the heat in his subway car, with the air conditioning off, was almost unbearable and that he had to calm an asthmatic woman who was having trouble breathing.

"It was almost like being in a sardine can, but it's being cooked while you're on it," Ignacio said.

Train traffic on the Manhattan Bridge was restored by about 9:30 p.m., with some delays, New York City Transit said. Service during the Thursday morning rush hour was not expected to be affected.

Several subway riders complained that it took more than an hour before firefighters arrived, pulling some of them out through windows.