Spanish police have released CCTV footage showing a plain-clothed, off-duty policeman rescuing a woman who fainted and fell onto the rails at a Madrid metro station.

The unnamed 38-year-old policeman heard the impact of the body hitting the rails and immediately sprung into action, police said.

The incoming train managed to stop on time because the driver realised there was a problem when people ran frantically on the platform while others waved in the direction of the train signalling it to stop.

The 52-year-old woman was immediately attended to by a doctor who was at the station and subsequently by an emergency service team, the police news release said.

The accident happened yesterday afternoon at the Marques de Vadilla station in the Spanish capital.