Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

CAIRO — Two passenger trains collided on Friday just outside Egypt's Mediterranean port city of Alexandria, killing at least 36 people and injuring about 123, according to two medical officials.

A statement by the Egyptian Railways Authority said a train traveling to Alexandria from Cairo, Egypt's capital, crashed into the back of another train, which was waiting at a small station in the district of Khorshid, just east of Alexandria.

A general view of people by the wreckage after two passenger trains collided in Alexandria, Egypt, on Friday. Hazem Gouda / EPA

The stationary train had just arrived from Port Said, a Mediterranean city on the northern tip of the Suez Canal, when it was hit, according to the statement.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

The statement did not say what caused the accident, saying only that the authority's experts would be investigating.

Associated Press video footage from the scene showed mangled train coaches on the tracks as hundreds of onlookers and victims' relatives gathered around on both sides of the tracks.

Ambulances were standing by and riot police were deployed to keep the onlookers away from the scene of the disaster.

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

Friday's collision was the latest in a series of deadly accidents that have claimed hundreds of lives over the years. Figures recently released by the state's statistics agency show that 1,249 train accidents took place last year, the highest number since 2009 when the number reached 1,577.

Friday's accident was the deadliest rail accident since 2006, when at least 51 people were killed when two commuter trains collided near Cairo.

Two trains are seen after they collided just outside Egypt's Mediterranean port city of Alexandria, Friday. Ravy shaker / AP

And earlier, in 2002, a massive fire engulfed 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 Egyptian 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 and more than 100 were injured in a train derailment south of Cairo.