Dozens of people were killed and injured at the main train station in Egypt's capital Cairo on Wednesday when a locomotive smashed through a concrete buffer stop, causing an explosion and fire.

At least 25 people were killed and 50 injured in the accident, according to state television reports.

Egypt's transport minister reportedly resigned following the accident, according to a cabinet official.

Footage circulating on social media from a security camera inside Ramses station showed the train smashing through the buffers and a metal end railing as people walked by.

A second camera captured people running from the explosion, some with their clothes on fire.

"I was standing on the platform and I saw the train speed into the barrier," eyewitness Mina Ghaly told Reuters.

"Everyone started running but a lot of people died after the locomotive exploded."

"I saw at least nine corpses lying on the ground, charred."