Jared Frank

Jared Frank takes a boot to the head while taking a selfie in front of a train. (YouTube)

A Saskatchewan man who just wanted to take a selfie in front of a train has become an internet sensation, after he was kicked in the head by someone on a speeding locomotive.

A YouTube video shows Jared Frank, 22, of Regina in Peru, taking a video selfie while standing in front of a passing train.

A split second later, he takes a boot to the noggin from someone at the front of the train with black shoes and wearing a uniform — apparently a conductor. The blow leaves Frank uninjured but reeling.

"Wow, that guy kicked me in the head," he is heard saying in the video that has received more than nine million views after two days.

"I tried to take a selfie while a train passed a 'safe' distance behind. I guess I was still too close and got kicked in the head," Frank said on his YouTube page, where he goes by "Jared Michael."

Frank, who is originally from Cupar, is a manager in training at Jump.ca, the Saskatchewan internet service company.

Newspapers, websites and television stations around the world have run the clip.

On Thursday afternoon, after the YouTube clip had tallied millions of views, CBC News caught up to Frank who explained how the event unfolded.

"I was in South America, on a trek to Machu Picchu, and I was walking on these train tracks," he said. "The first time the train came ... it was going incredibly slow and I stepped off the tracks and it moved by and it was fine."

Later, Frank said, he was on the same tracks and listening to music when he heard another train coming and — based on his previous experience — figured it would be safe to capture some video with the train moving behind him.

skpic jared frank

Jared Frank says the reaction to his nine-second video is 'hilarious'. (CBC)

"So I stepped off the tracks and got my camera ready [and] by the time I hit play [to record] and before I could even look where the train was, it already kicked me in the head," he said. "It was going way faster than it was before."

Some comments on the video noted how the kick could have killed him, while others said the person who gave him the boot may have prevented Frank from being struck by metal from the train and might have saved his life.

Lesson learned

Frank said he learned a valuable lesson.

"The moral of the story, I guess, is just not to take trains for granted and assume that they're always going to go slow," he said. He added he was shocked by what happened, but wasn't hurt.

He said he did not expect it to capture so much attention online.

"I almost don't know what to think," he said. "I knew what the internet was capable of, but the fact that people all around the world ... are talking about it ... it's hilarious."