An afternoon meant to commemorate a life moment turned out to be the last moment in a teen's life, when the 17-year-old Oregon boy was struck and killed by a freight train that barreled through while he was near a train bridge to pose for senior photos, officials said.

The incident happened Saturday around 6 p.m. near the Troutdale Bridge along the Columbia River Highway in the city of Troutdale, located about 15 miles east of Portland, Union Pacific told Fox News.

The Multnomah County Sheriff’s Office said they believe the teenager and another person were on the tracks taking photos to mark the boy's senior year in high school when he was struck and killed by an oncoming Union Pacific freight train.

CALIFORNIA PASSENGER IMPALED IN LEG AFTER METAL BAR FALLS OFF TRUCK, STRIKES CAR, POLICE SAY

The other person, a female photographer, was "very shaken up" by the incident, officials told FOX12.

Union Pacific said that Multnomah County Sheriff deputies responded to a call that a teenager had been hit by a train and found the teen dead at the scene.

“Our thoughts are with the teen’s family and friends," Union Pacific said in a statement to Fox News. "We plead with parents, students and photographers to not take photos on or near the tracks."

The area where the tragedy took place has fences nearby and signs posted that warn "No Trespassing. In addition to "No Trespassing" stencils are emblazoned on the tracks themselves.

CALIFORNIA MAN, 3-YEAR-OLD SON DIE AFTER BEING STRUCK BY ALLEGED DUI DRIVER, MOTHER CRITICALLY INJURED: POLICE

The 17-year-old's identity has not yet been released by the medical examiner's office. Someone who was in the area when the accident took place told FOX12 the train was stopped at the scene for several hours while police investigated.

Union Pacific told Fox News the train's crew was not hurt.

CLICK HERE FOR THE FOX NEWS APP

According to the U.S. Department of Transportation, there were 560 trespasser fatalities on railroad tracks nationwide in 2017, an increase of 80 from the previous year. The trend in rail trespasser fatalities has "substantially increased" over a 10-year period, with a 25 percent increase over a decade, according to the agency.

"Trespassing on railroad property is the leading cause of all rail-related deaths in the United States," the Federal Railroad Administration said in an October 2018 report. "More people are struck and killed by trains each year while trespassing – illegally entering or remaining on a railroad right-of-way – than in motor vehicle collisions with trains at highway-rail grade crossings."

For those who do walk along train tracks, officials stress that oncoming trains are not able to stop quickly. A train traveling at 55 mph takes a mile or more to come to a complete stop, according to the FRA.

Operation Lifesaver, the nonprofit rail safety education organization, has also urged photographers considering a photoshoot on tracks to go elsewhere.

"An optical illusion makes it hard to determine a train's distance from you - and its speed," according to the group.