A train driver has been killed and at least 37 people injured, five seriously, after a commuter train derailed and crashed near Barcelona, just two days after a tragic collision involving two trains in southern Spain.

According to local officials, the Rodalies train collided with a retaining wall that collapsed onto the track between Gelida and Sant Sadurní. Emergency services reported that all passengers were successfully evacuated from the train.

The incident occurred during heavy storms affecting northeastern Spain, prompting high alert for coastal areas in both the east and northwest.

Rail officials indicated that the wall fell as the train was passing shortly after 21:00 (20:00 GMT), impacting the driver's cab before causing significant damage to the first carriage, where most injured passengers were located.

While the identity of the driver has not been confirmed, it is known that three trainees were present in the driver's cab at the time of the derailment; firefighters indicated that two of the trainees suffered serious injuries.

The rescue effort was complicated, taking nearly an hour to free one survivor trapped at the scene in Gelida, located approximately 35 km (22 miles) west of Barcelona.

As investigations continue, all services across Catalonia's Rodalies commuter rail network have been suspended for safety checks, disrupting around 400,000 commuters, according to reports from Spanish newspapers.

The Spanish train drivers' union, Semaf, has organized a strike in response to the recent accidents, which included a catastrophic collision in Córdoba, Andalusia, resulting in at least 43 fatalities after high-speed trains collided.

Local officials in Catalonia suspect that the wall's collapse may have been exacerbated by heavy rain following months of drought conditions.

In a separate incident from the same day, another train on the Barcelona commuter network derailed due to a rock dislodged by the storm.

As investigations unfold into these recent tragedies, the imperative for enhanced rail safety and infrastructure stability continues to resound throughout the region.