Two missing Fullerton Fire Department (FFD) firefighters were found on Tuesday after surviving a harrowing six-day backpacking trip in California’s Yosemite National Park, during which they lost their way.

“This whole situation would have had a different outcome had it not been for our two members’ experience,” FFD Chief Wolfgang Knabe said Wednesday during a news conference about Fire Capt. Javier Avelar, 48, of Rancho Cucamonga and Dave Brown, 32, of Huntington Beach. The fact that they “were backpackers, the physical fitness shape they were in and lastly, their desire to survive,” were all factors Knabe credited for the men’s survival.

According to the Orange County Register, the men started their annual trip in the White Wolf area of Yosemite on Wednesday, September 7 but had become lost on Saturday after discovering their trail had burned during recent brush fires.

They reportedly spent Saturday and Sunday trying to find a different path to lead them to safety, using their fingertips to climb rocks above ground, which the Register notes left them with cutes and bruises on their hands and feet.

They eventually found two hiking paths and opted to take the shorter one. They came to a boulder near the Hetch Hetchy Reservoir, which they decided to swim through, which separated them.

The men reportedly spent at least one evening in the cold without food or fire and alone. Brown, a 21-year veteran of the department, found a ranger station Tuesday morning. From helicopters, and with Brown’s help, searchers were reportedly able to locate Avelar, who was wet and shivering near the reservoir’s shoreline.

The Register notes that Avelar had frostbite, hypothermia and was dehydrated. Brown injured an ankle.

“When he was found, there probably wasn’t a dry eye in the house,” Knabe said.

The men will be evaluated to see how long it will take for them to return to work in the fire department.

Follow Adelle Nazarian on Twitter and Periscope @AdelleNaz