Maks Merela, who leads the Cave Search and Rescue Unit, said the five were transported by boat through some sections of the 8.2 km network of underground lakes and walked through others.

"They are now in a warm place, everybody is okay, all of them are positive and the rescue mission was successfully competed," Merela told Reuters by phone.

The five, a family of three adults and two guides, had taken shelter more than 2 km from the entrance to the Krizna Jama cave in southwestern Slovenia, which can only be visited by boat.

Over the past two days, divers managed to take them food, water, medicines and a heated tent, but the high water level had made their evacuation impossible.

Merela said that this was the first time people had been trapped in Krizna Jama, a chain of lakes with emerald green water, the fourth largest known cave ecosystem in the world in terms of biodiversity.

"There was a disastrous situation with flooding in Slovenia last year," he said. "The land has not absorbed all the water yet."

Last August, Slovenia was stuck by the worst floods on record that killed six people and swept away homes.

(Reporting by Daria Sito-Sucic; Editing by Nick Macfie)