A witness said there was an explosion when the train rammed into a steel barrier at Ramses station.

At least 20 people have been killed and 50 injured after a train smashed into a barrier at Cairo’s main train station, state television and witnesses have said.

Photographs on social media showed clouds of black smoke billowing from the building in central Cairo.

Footage also showed fire engulfing the train and a nearby platform and people rushing to help the injured.

Ambulances and rescue teams have been dispatched to the site, medical sources said.

Egypt‘s National Railway Authority confirmed the accident, saying several people were killed and injured.

In a statement, the authority said the fire broke out after a train derailed and collided with a concrete barrier at the station, without giving further details.

Security sources told the Reuters news agency that there was no indication the crash was deliberate.

Egypt’s Transport Minister Hisham Arafat has resigned following the tragedy.

Latest on Egypt's deadly train crash: – At least 28 people killed and 50 others injured

– Train reportedly sped into station and caught on fire

– Egyptian transport minister resignshttps://t.co/TuTQRvJH87 pic.twitter.com/aKoEwGH7Qe — Al Jazeera English (@AJEnglish) February 27, 2019

A witness said there was an explosion when the train rammed into a steel barrier.

“I was standing on the platform and I saw the train speed into the barrier,” witness 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.”

Witness Ibrahim Hussein said: “I saw a man pointing from the locomotive as it entered the platform, and screaming, ‘There are no brakes, there are no brakes’ before he jumped out of the locomotive. And I don’t know what happened to him.”

Several witnesses said they had seen fire coming out of the train’s engine before it crashed, causing an explosion and fires inside the station.

Video footage from Cairo's Ramses train station shows a platform engulfed in flames pic.twitter.com/AWyrSwoJrc — Arab News (@arabnews) February 27, 2019

EGYPT: 24 dead, dozens injured in an explosion at a station in Cairo, Egypt pic.twitter.com/WMctq1vlJa — Khalid (Halit Ertuğrul) (@khalid_pk) February 27, 2019

“Any person found to be negligent will be held accountable and it will be severe,” Prime Minister Mostafa Madbouli said as he arrived at the site.

Egypt has one of the oldest and largest rail networks in the region and accidents causing casualties have been common.

Egyptians have long complained that the government has failed to deal with chronic transport problems in the country, where roads are as poorly maintained as railway lines.

The official statistics agency says there were 1,793 train accidents in 2017.