The crash, which it described as an accident, happened during rush hour Friday morning at the Estacion de Francia, a major railway station in the western Spanish city.
One person is seriously injured, 19 people are in a less serious condition, including the train conductor, and another 34 people suffered minor injuries, the emergency services said.
The department earlier said at least 18 people required hospitalization.
No deaths have been reported, authorities said. The cause of the accident is under investigation.
A video posted on Twitter by Felix Rios appeared to show that the front of the train had crumpled as it hit the buffers.