It is still uncertain how many passengers were injured, although early reports mention as many as 50, one of them in very serious condition. There were 65 people on board the Portuguese train, which was covering the Vigo-Porto route.
One of the fatalities is the train driver, a Portuguese national.
The accident took place at around 9.25am, after the first car went off the rails some 200 meters before pulling into the station. The other carriages sustained minor damage.
Preliminary reports suggest that the train derailed as it was coming round a bend; it hit a bridge and stopped after crashing into a steel tower structure.
Some passengers said the train was going quite fast and suddenly put on the brakes, causing luggage to fall out of overhead compartments.
O Porriño Mayor Eva García de la Torre told SER radio station that work was carried out recently in the area to ensure that trains “going right through the middle of town” would slow down.
The train is owned by Comboios Portugal, according to the same source. Renfe and Comboios Portugal have been jointly operating the Vigo-Porto service since 2011.
All railway traffic has been cut off between the stations of Louredo-Valos and O Porriño, which is located in the northwestern region of Galicia.
An investigation is underway to determine the cause of the crash, Adif said.
Regional premier Alberto Núñez Feijóo, who is up for re-election on September 25, has cancelled a campaign rally scheduled for Friday. Other politicians have placed their own campaiging on hold following the accident.
Spaniards still have fresh memories of the train accident that killed 79 people and injured 140 on a curve near Santiago de Compostela, also in Galicia, on July 24, 2013.