A humpback whale stranded for days in shallow water off the coast of Germany and given a very slim chance of survival, has swam free – but it is not out of danger yet.

The marine mammal, assumed to be a young male, became stuck on an “underwater ramp” near the Baltic Sea resort of Timmendorfer Strand, off the northern coast of Germany, on Monday.

Marine biologist Robert Marc Lehmann, who accompanied the operation, gave the whale 0.1% chance of survival earlier this week, stating that it was in the “worst possible position” and had a rope hanging from its mouth.

Subscribe for free to our weekly newsletter for exclusive and original coverage from ITV News. Direct to your inbox every Friday morning.

But an excavator spent Thursday digging an escape channel near the whale’s head, enabling the animal to swim through it overnight, Lehmann confirmed on Friday.

He cautioned that the whale, which is 12 to 15 metres long, will only really be at home again if it reaches the open Atlantic Ocean – some 600 nautical miles away.

The whale is under a “police escort” with support from at least six vessels, including the coast guard and the German Life Saving Association (DLRG), as it swims through Danish waters.

A trench was dug under the humpback whale’s head Credit: Dpa via APRobert Marc Lehmann gave the whale 0.1% chance of survival Credit: Dpa via AP

“I’m cautiously optimistic. The whale is in poor health,” Lehmann said.

“Its skin looks bad, it’s weak, and it hasn’t eaten in a long time.”

The whale was spotted stuck on an underwater sandbank on Monday morning, and initial efforts to free it and coax it back toward deeper water, including using coast guard and fire department boats to create large waves, were unsuccessful.

Humpback whales are not native to the Baltic Sea, which lacks strong tides that could have helped the stranded whale to free itself.

Lehmann told reporters on Thursday that the whale was reacting but was visibly suffering.

Reporting History sees journalists join News At Ten anchor Tom Bradby to revisit their remarkable on-the-day reports of the defining events of the modern age. Listen to the episodes below…