A group of 10 teenagers, who were hiking on the trails of a Southern California canyon, was lost for hours until a search and rescue team found them using an iPhone feature.

The 16-18-year-old hikers were stuck in the "Last Chance" area of the Santa Paula Canyon on May 12 and could not find their way back, the Ventura County Sheriff's Office said in a statement.

Officials said the teenagers "were not prepared for the hike" and did not have enough water, proper lighting or the right clothing to withstand temperatures that were in the 60s, reported CBS News.

"Most had t-shirts and shorts," Ventura County Sheriff's Deputy Mackenzie Spears told NBC News. "There were multiple water crossings and they needed to scramble" in certain parts of the hike or use their hands to climb steep terrain.

The group managed to send an alert for help using an Apple Emergency SOS feature, which provides key information such as the possible location and whether immediate medical aid was required.

The feature works on some iPhone models via satellite and allows people to call or text local emergency services even when the phone is not connected to cellular data or Wi-Fi.

The Ventura County Sheriff's Dispatch received a text message from the lost teenagers at around 8:00 p.m. Parents of the teenagers had also reported them missing.

"At approximately 8:30 P.M., the Upper Ojai Search and Rescue (SAR) Team was activated and immediately responded to the Santa Paula Canyon Trailhead. A total of 13 SAR members responded to locate the missing hikers," the sheriff's office said in the statement.

The search and rescue team endured low visibility, multiple stream crossings and trails damaged by heavy rains to locate the missing hikers.

After hiking for approximately four miles into the Santa Paula Canyon, the missing teenagers were found and "provided with food, drinking water and lighting equipment as they were led out ...," officials said.

The team returned to Santa Paula Canyon Trailhead at around 2:40 a.m., and the missing hikers reunited with their guardians.

The hikers did not require medical assistance.

Representational image
Representational image (Source: Pixabay / Andre_Grunden) Pixabay / Andre_Grunden