Updated

Emergency crews amputated the leg of a 19-year-old man in a Salt Lake City-area train yard after he became trapped under cargo, authorities said Friday.

Fox13Now.com reports that the unidentified man became pinned inside a railcar when a plate of steel shifted and may have been stuck for roughly eight hours.

South Salt Lake Fire Chief Ron Morris said crews had to extricate the teen, who is believed to be a transient who rode the train along with his dog prior to the accident.

“We believe he may have gotten on the train in Denver, came across this morning from Denver, we’re not sure what time,” said Morris. “The plate steel in the railway car shifted and pinned him. We believe he had been in there for maybe eight hours before he was found.”

Morris said crews worked for nearly two hours trying to free the man, who was later taken to a local hospital in critical condition.

“We ended up amputating one leg to get him free from the plate steel,” Morris said.

Officials said the dog was killed in the accident.

Morris said a surgeon was flown from University Hospital to amputate the leg during a two-hour extrication process.

Click for more from Fox13Now.com.