Forty-seven school children were killed on Saturday when a train smashed into their bus in central Egypt after a railway signal operator fell asleep, officials said, prompting protests and resignations.
Transport Minister Rashad al-Metini stepped down after the tragedy saying he "accepts responsibility."
President Mohamed Morsi also accepted the Egyptian Railway Authority chief's resignation.
Manfalut hospital in the province of Assiut said it had received 51 bodies -- those of the 47 children, the bus driver, two school supervisors and a passer-by.
"The children were between the ages of 4 and 12," deputy hospital chief Mohammed Abdel Razek told AFP.
Small coffins lined the wall at the entrance to the hospital in preparation for the children's burials.
The bus taking 60 children on a school trip was struck on a railway crossing in Manfalut, 360 kilometres (220 miles) south of Cairo, police said.
The worker manning the level crossing -- which had been left open -- was asleep when the bus tried to cross the tracks, Assiut governor Yehya Keshk said. "He has been arrested of course.
"There is a team of 45 doctors looking after the injured children," Keshk said.
Parents of the children held angry demonstrations near the scene of the accident, demanding the death penalty for those responsible, police said.
Some residents blocked the line with blazing tyres.
"We will not clear the railway line until we get justice for our children. This is not the first accident to happen here," said resident Mustafa Abuloyun.
"We have made several complaints regarding the rail crossing, the officials ignored us," he told AFP.
Signup to our newsletter and follow us on Facebook and Twitter!
Others said rescue services came late.
"We called but they never answered," said Shaaban Farghaly, who said he had to cover the children's bodies with their school books.
Another resident Gamal Mekki, said he was woken "by the sound of a loud crash... The train pushed the bus 1500 metres (nearly one mile) before it stopped," he said.
In a brief television address, Morsi offered his condolences to the families and said those responsible would be referred to the public prosecutor.
"On my and the Egyptian people's behalf, I offer my sincerest condolences to the families," the president said. "I am referring all those responsible to the public prosecution."
Earlier, Morsi ordered the prime minister, the defence and health ministers and the Assiut governor "to offer all assistance to the families of the victims," the official news agency MENA said.
Prime Minister Hisham Qandil and his interior minister headed to Assiut, the news agency added.
Activist groups have called for the resignation of Qandil's cabinet.
"This accident proves the failure of Qandil's government and strengthens the demands for the resignation of a government that has failed, over several months, to produce anything to improve the suffering of Egyptians," the April 6 movement said.
The railway network's poor safety record stems largely from lack of maintenance and poor management. In Egypt's deadliest railway tragedy, the bodies of more than 360 passengers were recovered from a train after a fire in 2002.
Keshk has ordered the "formation of a fact-finding committee" to probe Saturday's accident, but in similar tragedies in the past, such panels have done little to shed light on the details and less still to bring about accountability.
In a separate road accident, 12 people were killed and three injured when a truck smashed into a minibus near the Egyptian capital.
Officials said a speeding truck driving on the wrong side of the road crashed into a minibus carrying 15 passengers. The truck driver was arrested at the scene in the 6th October area, as rescue services worked to extract the bodies, police said.
Egyptians have long complained that the government has failed to deal with the country's chronic transport problems, with roads as poorly maintained as railway lines.