The hiker, who had broken her leg, was spotted while the train rode between Durango and Silverton, Colorado.
CNN  — 

A Colorado train passenger helped lead to the rescue of a missing, injured hiker after she spotted her through a train window.

The passenger was riding Colorado’s Durango and Silverton Narrow Gauge Railroad on October 10 when she spotted the hiker through the window and alerted the train conductor, according to a Facebook post from the San Juan County Office of Emergency Management.

The hiker, a woman from New Mexico, went missing after she began a hike on the Colorado Trail, says the office. She left the trail and headed along the Animas riverbank, where she fell, breaking her leg. She spent two nights injured in the wilderness, according to the office.

“It’s incredible she survived,” DeAnne Gallegos, a spokesperson for the San Juan County OEM, said of the hiker. “She had no food, very little water, no other survival gear. She only had shorts and a tank top and survived in 20-something degree weather.”

After the second night, she managed to find a high-visibility spot on the riverbank – and flagged down the passing train.

Two train staff who were also trained medics crossed the river and stayed with the hiker until the Silverton Medical Rescue team arrived, according to the office.

The missing hiker had broken her leg and spent two nights in the wilderness.

The train staff members were identified as Nick and Klyah Breeden.

The rescue operation was complex: The search and rescue team were flown in on a helicopter and used ropes to transport the injured hiker across the river. Then, a helicopter flew the patient to a nearby hospital. The search and rescue team were transported out of the riverbank area on a small train, according to the office.

“Another person in a moment of need was successfully brought home due to teamwork and collaboration,” wrote the office.

CNN’s Caroll Alvarado contributed to this report.