All Rodalies commuter and regional train services have been suspended in Catalonia.
The decision was announced by Spain’s national rail operator Renfe on Saturday morning.
The measure will be in place until the safety and full operational capacity of the tracks can be guaranteed.
The decision comes after a request from the Catalan government.
It also asked that, once service can resume, tickets be free for all passengers until full normality is restored.
It follows two derailments in the region this week, which killed one person and injured dozens of others.
In Gelida (Barcelona), a retaining wall collapsed onto a track on Tuesday evening, before colliding with a Rodalies commuter train.
The young driver, a trainee 27-year-old from Sevilla, was killed in the impact.
It came barely 48 hours after the Adamuz disaster in Cordoba, which has claimed 45 lives.
A series of other incidents on the Spanish rail network this week has shaken the confidence of train users.

