Twenty people died and 43 wounded when a fire broke out at a train station in Egypt's capital Cairo.

At least 20 people were killed and 43 injured when a locomotive smashed through the buffers at the main train station in the Egyptian capital Cairo on Wednesday, the health minister said.

Transport Minister Hisham Arafat resigned after the incident, the cabinet said in a statement. State television said authorities had arrested the train driver.

Footage circulating on social media from a security camera inside the Ramses station showed the train failing to stop as it arrived at platform six, smashing through the buffers and a metal end railing and exploding into a huge ball of fire.

Passengers carrying luggage ran for their lives as the fire spread, and several people were running covered in flames, witnesses said.

The health minister, Hala Zayed, said authorities had not been able to identify many of the 20 bodies recovered because they were too badly burned.

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."

Security sources said there was no indication that the crash was deliberate. The transport minister said the train's diesel tank had exploded.

Egypt has one of the oldest and largest rail networks in the region and accidents causing casualties are common. A train collision in Alexandria killed more than 40 people in 2017.

Egyptians have long complained that successive governments have failed to enforce basic safety standards for the railways.

The fire sent smoke billowing above the station. Inside, the train's charred engine could be seen tilted to one side next to a platform.

Investigation

Bystander Mina Ghaly added: "I was standing on the platform and I saw the train speed into the barrier ... Everyone started running but a lot of people died after the locomotive exploded.

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

Zayed said that as well as the 20 killed, 43 people were injured, 15 of whom had been released after treatment. State television earlier put the death toll at 25 and said 50 were injured.

Ahmed Youssef, a doctor at Al Helal hospital, close to the station, said more than 20 injured had been admitted, most of them in serious condition.

Witness Ahmed Abdeltawab said the platform had been crowded with passengers waiting for another train and people fled in flames.

"The fire overwhelmed them and they ran while they were on fire until they fell metres from the incident," he said. "The scene was terrifying."

Prime Minister Mostafa Madbouly, announced from the station that the incident would be investigated and anyone found responsible would be held to account.

Student Ali Ramadan said he had suffered burns and injured his foot when he ran into a concrete bench on the platform.

"I don't know when these train accidents will end ... They told us they got millions of dollars' worth of new locomotives and trains, and people are still dying because of train accidents," he said.

The Transport Ministry briefly suspended all arrivals and departures at the station before reopening all platforms except the one where the crash happened.