Two passenger trains have collided in Egypt's coastal city of Alexandria, killing 37 people and injuring 123, a health ministry spokesman said.

President Abdel Fattah al-Sisi ordered authorities to establish who was responsible for the crash, which left bodies strewn on the ground around wrecked carriages.

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.

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.

State newspaper al-Ahram said earlier that 36 bodies had been taken to hospital morgues in Alexandria province.

As rescue teams pulled dead and injured from the damaged rail wagons, public prosecutor Nabil Sadek ordered an urgent investigation.

A railroad switching error most likely caused the crash, a security source said without giving further details.

One resident, Hoda, was standing on her rooftop when she saw the trains collide.

"They rose in the air forming a pyramid when they collided," she said.

"I started to scream from the rooftops for people to grab some sheets and run."

A health ministry spokesman said 75 ambulances had been deployed at the crash scene. Some people were still stuck inside the trains, a medical official told state TV.

"The train I was riding was going very quickly," said passenger Moumen Youssef.

"I found myself on the floor. When we came out, we found four train cars crushed and a lot of people on the ground."

This collision was the latest in a series of deadly accidents in Egypt that have claimed hundreds of lives.

Figures recently released by the state's statistics agency showed that 1,249 train accidents took place last year, the highest number since 2009 when the number reached 1,577.

In 2002, a massive fire engulfed a train filled with local holiday travellers.

The train sped for miles, with flames engulfing one carriage after another, killing more than 370 people.

In 2006, at least 51 people were killed when two commuter trains collided near Cairo.

And later 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 people, 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.