FILE PHOTO: People gather at the main train station after a fire following a train crash caused deaths and injuries in Cairo, Egypt, February 27, 2019. REUTERS/Amr Abdallah Dalsh/File Photo

CAIRO (Reuters) - Egypt’s public prosecutor ordered on Thursday the detention of six people for four days in connection with a locomotive that smashed through the buffers and burst into flames at Cairo’s main train station on Wednesday.

The train’s driver, his assistant, another train driver and three other rail employees will be held for four days pending investigations into the incident, the public prosecutor said in a statement.

Egypt’s Health Minister Hala Zayed said on Thursday the death toll from the crash rose to 22. State TV had said on Wednesday that 25 people died in the crash, but the health minister revised the toll down to 20 later in the day and said 43 people were injured.

Egypt’s public prosecutor said on Wednesday that a preliminary investigation indicated the driver stepped off the train to talk to another driver without pulling the hand brake, causing the unattended locomotive to speed off and hit a concrete platform.

Security camera footage from inside the capital’s 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.

Transport minister Hisham Arafat, who said the train’s diesel tank had exploded, resigned on Wednesday.

Electricity Minister Mohamed Shaker will temporarily head the transport ministry, a cabinet source said on Wednesday.