PAHANG, Malaysia -- A small herd of elephants in Malaysia became trapped after they wandered into an abandoned mining pool.

The five elephants, including one baby, were discovered Tuesday. They live in the Pahang Forest Reserve, about 125 miles east of Kuala Lumpur.

Indigenous people found the elephants and contacted forest rangers. Malaysian's Department of Wildlife brought an excavator to dig the frightened elephants a path to freedom.

The adults put the baby between them as the noisy excavator worked to dig the path. Even after the path was opened, it took a while to get the elephants to turn around and move to the opening.

Finally, to cheers of people watching, an adult elephant took the first step to freedom, followed by another adult, then the baby.

Forest rangers believe the elephants were trapped two to three days.

RELATED: From tusks to tails, nations eye trade in endangered species

RELATED: Bindi Irwin, Steve Irwin's daughter, is engaged