Two subway cars of an A train derailed Tuesday morning at the 125th Street station in Harlem, causing dozens of injuries, officials said.

The train derailed about 9:50 a.m. As many as 34 people were hurt, with six transported to nearby hospitals, officials said.

MTA officials said an emergency brake was activated as the train approached the A/C/D/B station at St. Nicholas Avenue.

Passengers took to social media to describe the unfolding drama in which smoke filled the stricken train at St. Nicholas Avenue.

“Train derailment near 125 A train. Huge bang, sparks and smoke. We were stuck underground for a while …,” tweeted @gcmarts.

“There was a crash and the subway literally broke. F—eerie. The floor of the train was literally broken,” another passenger tweeted.

“Just got evacuated from a smoke filled train in probably the most terrifying 15 minutes of my NYC life,” @RokhlK added.

A third passenger said the train derailed about 9:50 a.m. Tuesday.

“Just got off the derailed A train that crashed into the subway wall,” @McKrell84 said.

“Folks calmed quickly and within 5 minutes MTA personelle were clearing passengers forward onto the 125 platform,” McKrell84 said. “Passengers were scared but considerate.”

The MTA posted alerts on its website that the incident involved a power outage that stopped service on the A, B, C and D lines.

“The investigation between 59th Street-Columbus Circle and 125th Street is causing delays in both directions,” the MTA announced earlier.

There was no A train service between Jay Street-MetroTech and Inwood-207th Street in both directions.

B train service was suspended between Brighton Beach and 145th Street in both directions.

On the C line, service was suspended between Euclid Avenue and 168th Street in both directions.

There was no D train service between 42nd Street-Bryant Park and 161st Street-Yankee Stadium in both directions.

Shuttle D train service between 161st Street-Yankee Stadium and Inwood-205th Street was being provided in both directions.