Police identified the teen killed by a train in Leduc on Monday as 19-year-old Daniel Michael McPherson, a student at Leduc Composite High School.

Police investigate at the scene near 50th Avenue and Black Gold DrivePolice investigate at the scene near 50th Avenue and Black Gold Drive (CBC)

McPherson was struck from behind by a southbound Canadian Pacific freight train around 3:30 p.m. near 50th Avenue and Black Gold Drive.

He was walking on the tracks with his back to the train while wearing headphones, police said.

A memorial for the teen was set up in the school library and grief counsellors were on site to help students.

McPherson had just returned to school two weeks ago to finish his high school diploma.

"He was coming back 'cause that's what he wanted to do," school principal Bill Romanchuk said. "He didn't have to come back. This was his choice."

Romanchuk said McPherson left school at 3:15 on Monday.

"By 3:30, he wasn't with us anymore so it's really tough."