MT. BALDY >> A Fontana sheriff’s deputy helped guide a group of unprepared, lost USC students hiking Mt. Baldy back to safety on July 4th, sheriff’s officials said.

The students managed to summit the mountain Tuesday, but became lost during their descent, according to a San Bernardino County sheriff’s news release.

When the five Los Angeles-area hikers realized they had taken a wrong trail, they called the Fontana station around 6:20 p.m., officials said.

Deputy Jon Thorp learned the students didn’t have food, water or a flashlight and that one of the group members had a sprained ankle, according to the statement.

Thorp determined the students had hiked into Los Angeles County, and the deputy alerted the Los Angeles County Sheriff’s Department, sheriff’s officials said.

Thorp found the hikers and conducted an evaluation of the students, officials said.

The Los Angeles County Fire Department arrived, and Thorp and firefighters guided the students off the trail.

Sheriff’s officials advise all hikers to be properly prepared before undertaking an excursion and to have the appropriate clothing, food, water, gear when hiking in the wilderness.