Five undocumented immigrants who had been walking in the Arizona desert for more than two weeks were rescued on Saturday. The Maricopa County Sheriff’s Office found the five immigrants, gave them medical treatment and turned them over to the U.S. Border Patrol, the Arizona Republic reported. It all happened in record-high temperatures.

The sheriff’s office got a 911 call at about 11 a.m. from a man requesting to be located and helped in the desert east of Gila Bend, a news release said. The man said the group he was with had been walking for 15 days. They reportedly had been drinking their own urine to stay alive.

“They were in very, very bad shape. Some were at the point of passing out," sheriff's office spokesman Deputy Joaquin Enriquez told the New York Daily News.

The deputies had trouble discerning the whole story as the information was coming through a Spanish translator. Police initially thought there were two groups and 20 people lost in the desert, but when they responded they found only three men. The immigrants informed the officers there were two other people nearby, and the police quickly found them, as well.

The group was airlifted to a local hospital, and the Border Patrol took over the case.

Immigrants often attempt to walk from Mexico into Arizona, a feat that takes about six days and proves dangerous for many. Some immigrants use a coyote, or a smuggler, to guide them, but others set out alone. Either way, it can end badly: From 1998 to 2013, the Border Patrol recorded finding more than 2,700 bodies in the desert.

“It's the harshest climate along the U.S.-Mexico border," spokesman Andy Adame told the Republic last year. "When you've got over 30 days of 100-degree weather, that makes it deadly for anybody crossing out there."

The weather was worse than usual this week, when the group of five were allegedly out in the desert. A high of 117 degrees Fahrenheit was recorded Friday at Phoenix Sky Harbor International Airport, the Associated Press reported.