News, views and top stories in your inbox. Don't miss our must-read newsletter Sign up Thank you for subscribing We have more newsletters Show me See our privacy notice Invalid Email

A Spanish man was electrocuted after climbing onto the roof of a train to take a SELFIE.

The 21-year-old died in Andujar, Andalusia , at 12 noon Saturday after clambering on top of a haulage locomotive with a pal.

The duo thought the train, parked in a siding at the town's station, was not electrified.

But its cables were in fact still connected and conducting a current.

As he went to snap the photo with his mobile phone, the victim accidentally touched a high-voltage wire.

The electric shock threw reportedly threw him from the train.

His friend also suffered a severe electric shock, but survived.

ABC reports that firefighters, police and paramedics rushed to the scene.

The electricity supply between local stations was cut so the pair could be attended to.

But it was too late, and the 21-year-old, from Vegas de Triana, was declared dead at the scene.

His friend was taken to Alto Guadalquivir Hospital, where he remains in a serious condition.

Andujar Mayor Jesus Estrella declared three days of official mourning in the town.