A young Pakistani man was killed on Tuesday after being hit by a fast-moving train as he tried to take a selfie with it, officials said.

Jamshaid Khan, 22, who was an employee of the railways department, tried to take the photo on his phone while standing on the track in front of the train in Rawalpindi city.

"Jamshed Khan, a resident of Dhok Ratta area in Rawalpindi city, died after getting hit by a train while taking a selfie in front of it," Deeba Shahnaz, a senior official of the rescue department, told AFP.

"The train crushed him and he was killed on the spot," she added.

A policeman at the local station confirmed the death but said Khan's father did not acknowledge that his son died while taking a selfie.

"Jamshed Khan's father Muhammad Pervez has said in his statement that his son died in an accident while crossing the track," the policeman said, adding that the deceased was a helper at the railways department.

Taking selfies is a popular trend in Pakistan, with many youngsters using the pictures to update their Facebook and Twitter pages.

It has become the norm lately for teenagers to take selfies wherever they go and post them on social media sites as soon as possible.