At least 20 people have been killed and 40 injured after a train crash sparked a large fire at Cairo's main railway station, Egyptian officials say.
The train hit a buffer stop near the end of a busy platform at Ramses Station, which is in the city centre.
The collision caused the train's fuel tank to explode, setting the platform and nearby buildings alight.
The cause of the crash is not yet clear, but only hours later Transport Minister Hisham Arafat resigned.
Witnesses described seeing several severely burned bodies in the latest disaster to hit Egypt's rundown railways.
State-run media earlier reported a higher death toll of at least 25 and as many as 50 injured.
During a visit to the scene, Prime Minister Mostafa Madbouli vowed to severely punish anyone who was found to have been negligent.
"We will identify who is responsible for the accident and they will be held accountable," he said.
President Abdul Fattah al-Sisi extended his condolences to the families of those who died and pledged to ensure that the injured received the support they needed.
Local media published what they said was CCTV footage showing people on the busy platform as the train hits the buffer at high speed and explodes.
Another video, taken from a CCTV camera above a nearby subway staircase, appears to show people fleeing as a fireball engulfs the platform.
"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," witness Ibrahim Hussein told Reuters news agency.
"I don't know what happened to him."
"I removed nearly 20 bodies, and carried them to the ambulance, all of them completely burned," Ahmed Mahmoud told news agency AFP.
"[The train] should have slowed down as it was about to enter the station, but it came in too fast."
The privately owned news website al-Shorouk cited a source as saying the train had been undergoing maintenance when it started moving at speed towards the station's main building without a conductor.
The source added that this was not the first incident of its kind, explaining that there had been two other cases of a train moving without a conductor that had not resulted in any deaths or injuries.
Egypt's railway system has a poor safety record, which many observers blame on a lack of investment by successive governments and poor management.
In August 2017, 43 people were killed and more than 100 injured when two passenger trains collided outside the Mediterranean port city of Alexandria.
The country's deadliest rail accident occurred south of Cairo in 2002, when a fire ripped through an overcrowded passenger train, killing more than 370 people.