Nearly 40 passengers were injured, two of them seriously, when a double-decker commuter train crashed into a track buffer at a station outside Madrid, Spanish authorities have said.

The Madrid region’s Summa 112 emergency services initially reported that 45 people were treated and four suffered serious injuries from the afternoon accident, but it later lowered the total number of those seen to 39.

Emergency services at the scene
Emergency services at the scene (Paul White/AP)

In a statement, the service said two were taken to hospital with serious injuries, 11 more had moderate injuries and the rest were treated for bruises and anxiety.

Spain’s railway operator Renfe said the accident happened at 3.37pm (1437GMT) at the end of a track at Alcala de Henares station, some 40 kilometres (24 miles) east of the Spanish capital.

A passenger is taken to hospital
A passenger is taken to hospital (Paul White/AP)

Renfe said in a statement it was investigating the cause of the crash.

A similar accident involving a commuter train that crashed into a buffer in Barcelona sent more than 50 people to hospital in July at the height of the tourism season.

Last month, 27 people were injured after a passenger car derailed when a track flooded between the southern Spanish cities of Malaga and Seville.