German authorities were investigating the cause of a train accident on Wednesday after dozens of people were injured in a collision near the city of Düsseldorf.

Marcel Winter, a spokesman for the British-owned National Express railway, said it remained unclear why the passenger train traveling from Cologne to Krefeld struck a Deutsche Bahn cargo train on its way to Rotterdam on Tuesday night.

Clean up crews were still on the scene on Wednesday afternoon, and Winter added that the line would remain closed until the debris was cleared away and the electrical overhead wires repaired. Repair work to the tracks is expected to take at least a few days.

The driver was praised for swiftly applying the emergency brake and slowing the passenger train

It emerged on Wednesday that the driver of the passenger train had slammed on the emergency brake as soon as he saw an obstacle on the tracks, avoiding a much more serious collision.

"We were very lucky," said Winter. "It could have been much worse."

Initial reports indicated that 50 people had been injured in the incident, but that number was later revised. Police said that nine of the 41 passengers wounded were seriously hurt, while the other 105 on the train were able to walk away unscathed.

Later on Wednesday, an expert from Germany's Federal Railway Accident Investigation Board (BEU) said that "the passenger train should not have been allowed to drive on this particular track."

BEU spokesman Gerd Münnich said that the cargo train was standing still and waiting for a signal to enter the station at Meerbusch when the collision occurred. Subsequent trains are not allowed to drive on to the same tracks when the train in front of them is stationary.

Passengers remained calm, says witness

The crash occurred around 7:30 pm local time (1830 UTC) in the small town of Meerbusch, in Germany's most populous state of North-Rhine Westphalia (NRW). The front car of the train was heavily damaged, but the rest of the train was largely unaffected.

The fire department was able to rescue the last of the passengers at around 9:15 pm, after initially being unable to reach the site due to damaged high-voltage wires.

Passenger Lukas Kehler, 19, told public broadcaster WDR that the crash had been loud and frightening, but that all on board had remained calm.

"There was no sense of panic," he said.

Images showed that there was moderate damage to the passenger train's front carriage, while the others appeared largely unaffected. Some of the cargo train carriages were thrown off the rails, however, as a result of the collision.

Most train services in Germany are run by the partly-state owned Deutsche Bahn, but National Express has been operating some routes in NRW since 2015.

es, dm/msh (AFP, dpa)