At least 39 people were injured when an A train derailed in Harlem Tuesday morning, the FDNY said.

Two cars on a southbound A train derailed at the West 125th Street station and rammed into a concrete wall around 9:45 a.m., bringing extensive damage to track, signal and other infrastructure near the station, according to MTA and union officials. 

Power outages at stations between 59th and 125th streets occurred minutes after the derailment, according to the MTA's timeline. Commuters shared images and videos on social media of passengers navigating dark train cars during the outage.

The impact of the derailment rippled through the line, stalling another 800 riders on nearby trains between the 110th Street (Cathedral Parkway) and 135th Street stations. Of those riders, about 500 decided to leave their trains and enter the tracks in what FDNY Commissioner Daniel Nigro described as a "self-evacuation."

Passengers were evacuated from the derailed train, as well as three other trains, including one C and one D, that were also in the tunnel at the time, the MTA said. 

The fire and police departments conducted a joint operation – involving 300 responders – in order to round up the passengers and bring them above ground, Nigro said.

"Thankfully we have the resources" to evacuate and treat people, Nigro added. At least 39 people suffered minor injuries, with 17 taken to area hospitals, the FDNY said. 

Paul Navarro, director of subway safety at TWU Local 100, the union representing subway workers, visited the scene and said the train was "peeled open like a can of tuna fish."

“The signals were floating in the air — they were being held by the wires, as opposed to the pole that secures them to the ground. I’ve never seen that before," Navarro said.

The derailment occurred shortly after the train’s emergency brakes were activated, according to MTA Chairman Joe Lhota, who visited the station after the crash.

“The train bucked forward, it bucked backwards and in the process of doing that … two of the cars derailed; they scraped the side of the wall,” Lhota told reporters at the scene.

After hours of investigation on Tuesday, an MTA spokeswoman said it was not yet clear who activated the brakes, why they were activated or if the brakes were the cause of the derailment. 

Navarro said he thought it was unlikely that the brakes played a role in the crash.

“If you slam the brakes on your car, your car doesn’t fall apart,” Navarro said.

Passengers of the derailed A train described a chaotic scene, where riders were screaming in fear after the train hit the wall of the Harlem station, causing an "explosion."

"I was the second car from the end. It was a smooth ride, then the train felt jerky ... then it gets severe and I saw an explosion, the train comes to a stop – people start screaming," said Kelly Kopp, 48, of Washington Heights.

"It was scary. I literally thought I was going to die on a subway," he said. "I tried to open the door and it was locked. We tried to pry the door open and I thought, 'we are trapped and locked in.'"

Kopp said one passenger was able to kick a train car door open to get into another car, but that one was also locked. Passengers were on the train for about 20 minutes before MTA crews finally came to let them out, unlocking the doors and allowing them to jump down onto the tracks, Kopp said.

Another passenger said on Twitter that there were sparks seen after the train hit the wall inside the station. The sparks caused a small fire that lasted only briefly, Nigro said.

“Smoke and dust filled the air and there was a small panic," Ben MacKrell writes on Twitter.

Elected officials and transit advocates pointed to the derailment as a breaking point for a system that has experienced a soaring number of delays over the last five years alongside decaying service. Their ire was directed toward Gov. Andrew Cuomo, who advocates said has failed to fund the state-run agency to meet the demand for infrastructure upgrades while he also sidesteps the issue of degrading service.

“We’re seeing the effects of an outdated transit system,” State Sen. Michael Gianaris (D-Queens) said, pointing to underfunding as a crippling component. "We've got to do something. Without a functioning transit system the city is paralyzed."

City Councilman Ydanis Rodriguez, who's also the chairman of the council's Transportation Committee, called for a "line-by-line audit" of the MTA, to see how it spends money allocated for track maintenance.

"This is a breaking point. Enough is enough," Rodriguez said, speaking at 127th Street and St. Nicholas Avenue after the crash. 

"Riders on the A train had a terrifying experience this morning when a train derailed," John Raskin, executive director of the Riders Alliance, said in a statement.

"Incidents like this will keep happening until Governor Cuomo takes charge with a plan to fix a failing transit system," Raskin continued, also referencing a stalled F train that left commuters trapped underground for about 45 minutes in early June. "What will it take for the governor to stop making excuses and start funding public transit?"

Transit advocates later announced plans for a rally outside of Cuomo's office on Wednesday to demand the governor release a plan to "fund and fix" the system.

Cuomo answered by promising Lhota, his recently appointed chairman, “any support” needed to address what he agreed to be a “crisis.”

"While the investigation is ongoing, this morning’s subway derailment is an unacceptable manifestation of the system’s current state. New Yorkers deserve better," the governor said in a statement released eight hours after the derailment. "It is my expectation that with new leadership brought by Joe Lhota, the MTA will address the fundamental issues plaguing the transit system and overhaul the organizational structure of the MTA."

"As I have told Joe, any support the MTA needs to get through this crisis, will be provided."

A, B, C and D train service was suspended as a result of the derailment, the agency said. Local service was restored on the A, B and D lines around 5 p.m., but some service changes persisted and C train service remained suspended.

As the investigation continued Tuesday evening, MTA crews were expected to work overnight with the hopes of restoring full service by the morning rush on Wednesday.

With Adeja Crearer and Matt Chayes