Spanish officials have blamed summer solstice party-goers for crossing the tracks into the path of an express train that killed at least 13, but others said a new underground exit was poorly marked and an old crossing was blocked off, leaving travellers confused.
In addition to the dead, at least 14 were injured in the beach resort of Castelldefels, south of Barcelona, shortly before midnight on Wednesday as crowds of young people left a train heading for bonfires on a Mediterranean beach. Many jammed the underpass leading to the beach, but about 30 others climbed down from the platform and tried to scurry across the tracks.
They were struck by a train passing through the station in north-eastern Spain.
Development Minister Jose Blanco has denied claims the underpass was poorly marked, and insisted that passengers should have known that "you never, never, never cross the tracks".
"Everything pointed to negligence," Mr Blanco added, saying he hoped the tragedy would make passengers understand that they must obey station rules.
But Arrellano Ruiz, the Ecuadorian consul in Barcelona, said passengers did not see the signs for the underpass exit and mistakenly headed to a footbridge that had been closed since a 2009 renovation.
Victor Morlan, Spain's infrastructure secretary, acknowledged that the bridge has been blocked off since last year but insisted there were enough signs telling passengers how to safely reach the beach.
"It had a sign system that was well made and it had a loudspeaker service that pointed out that the tracks must not be crossed," Mr Morlan said.
Most of the victims were Latin American, but authorities did not identify them or release a breakdown of their nationalities.
Of the 14 injured, one was in extremely critical condition, two were in critical condition, officials said. Except for one woman in her 40s, all of the injured were 19 or younger and two were minors.