Six baby elephants trapped in a mud pit have been rescued by rangers at a national park in northeastern Thailand.

The elephants were unable to climb out of the slippery pit, park officials said, prompting a rescue operation to create a pathway for the creatures to escape the trap.

SECOND ELEPHANT IN A WEEK DIES OF HERPESVIRUS AT INDIANAPOLIS ZOO

Rescuers took five hours on Thursday to dig a path for the elephants to clamber out of the pit. One by one the elephants then climbed out of the muddy ditch.

The animals were trapped at Thap Lan National Park in Nakhon Ratchasima province, with the head of park, Prawatsart Chantep, saying rangers discovered them on Wednesday afternoon.

MIAMI ELEPHANT DIES AFTER FIGHT WITH ANOTHER 'GOLDEN GIRL' PACHYDERM

He said there were signs that the trapped animals may be related to a herd of elephants that was circling the area,

CLICK HERE TO GET THE FOX NEWS APP

It remains unclear how the elephants ended up trapped in the pit.

The Associated Press contributed to this report.