CAIRO (AP) — A passenger train collided with a cargo train in Egypt on Wednesday, killing at least 12 people, including a child, in the latest deadly accident involving the country's underfunded and mismanaged railways.

Another 39 people were injured in the crash, which took place in the Nile Delta north of Cairo, according to the state-run MENA news agency. The Health Ministry said the trains were both bound for the capital.

MENA earlier reported that the collision killed 15 people and injured 40, before revising its toll downwards.

Mahmoud Goma saw the collision. He said he and other local residents loaded injured people into their cars to take them to the hospital, and that some died on the way.

Egypt's railway system has a poor safety record, mostly blamed on decades of poor management and maintenance.

President Abdel-Fatah el-Sissi has spoken about the need to modernize the railway system to prevent deadly accidents and improve services. Last year he said 180 billion Egyptian pounds (about $10 billion) were needed to overhaul the network, suggesting that ticket prices should be raised.

Deadly accidents have claimed hundreds of lives over the years.

In August, two passenger trains collided just outside Egypt's Mediterranean port city of Alexandria, killing 43 people, the country's deadliest rail accident in more than a decade. In 2016, at least 51 people were killed when two commuter trains collided near Cairo.

In 2002, a massive fire broke out on a train filled with local holiday travelers. The train sped for miles, with flames engulfing one carriage after another, killing more than 370 people. In November 2012, a speeding train crashed into a bus carrying children to their kindergarten in the country's south, killing more than 50, mostly children between the ages of four and six. Two months later, at least 19 people died in a train derailment south of Cairo.