The incident happened just before 9:55 a.m. near the 125th Street Station in Harlem.
MTA officials said the emergency brakes for a southbound 'A' train were triggered, causing the two cars to go off the tracks and strike the wall of the subway tunnel. The train was just north of the station at the time.
The MTA said they're looking into what triggered the emergency brakes to activate -- whether it was by someone pulling it or on its own.
The exact nature of the derailment is unclear, and the train is being checked. Sources told Eyewitness News there was significant damage to the train, which can be seen in the photo gallery below.
SCENE PHOTOS: 'A' train derails in Harlem
In all, 34 people suffered minor injuries in the ordeal -- 17 were taken to nearby hospitals for treatment. Some of the injuries were from possible smoke inhalation, as there was a smoke condition in the tunnel following the incident. Fire officials estimate that as many as 500 of the 800 people stuck on trains after the power outage exited the train into the tunnel on their own.
The FDNY said some trash apparently caught fire after the derailment, causing that smoke condition. Officials also advised riders not to get off the trains unless directed to do so by emergency personnel.
"Customers should never leave a train on their own -- it's dangerous and potentially deadly and it requires us to shut down entire lines and delay thousands of other customers because of the safety hazard it presents," MTA spokesman Kevin Ortiz said.
Two women who were on the train described what they experienced in this interview:
Video posted on social media shows people walking through a train with no lights:
One passenger posted on social media about her ordeal:
Just got evacuated from a smoke filled train in probably the most terrifying 15 minutes of my NYC life 😱— רח׳׳ל (@RokhlK) June 27, 2017
Seven different train lines were impacted as a result of the derailment.
Here's an additional report about the derailment from Eyewitness News: