Subway service was restored hours after a track fire in a tunnel forced the evacuation of as many as 4,000 commuters in two subway trains at the height of the evening rush hour.

The fire, reported around 6 p.m. Wednesday, halted two subway trains on the lower level of the Manhattan Bridge, which spans the East River between Manhattan and Brooklyn. Fire department officials said between 3,000 and 4,000 people were evacuated.

Several subway riders complained that it took more than an hour before firefighters arrived, pulling some of them out through windows. 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.

The fire department said power was shut off on the tracks so people could leave safely. More than a dozen people, including three firefighters, were treated at hospitals for smoke inhalation, officials said.

The fire was under control at about 8 p.m., officials said. Train traffic was restored by 9:30 p.m., said New York City Transit, which runs the subway system.

Fire officials said the fire appeared to be accidental, and that investigators found trash and cigarette butts around where the fire began, near what appeared to be a homeless encampment.