Incredible footage has emerged of beachgoers alongside a giant sperm whale after the creature was spotted 'dangerously close' to the shore.
A video shared online captured swimmers at Leighton beach, just north of Freemantle in Perth, approaching the whale, which had strayed into shallow waters.
In the footage, a group of curious beachgoers can be seen getting close to the massive creature before it was able to swim back out into the ocean.
Marine biologist Dr Natalie Sinclair said the whale could have been at risk of stranding, and that the behaviour it exhibited was 'unusual and perilous'.
She also warned that people should 'leave the whale alone' as swimming close could disorient the mammal.
'The proximity of individuals to the whale poses risk, not only to the animal, but also to the people involved,' she told the BBC.
It is understood the whale has stranded itself twice in the past two days, most recently at Rockingham Naval Memorial Park Beach.
Authorities said the animal, which is more than 15 metres long and weighs more than 30 tonnes, may have been looking for a place to rest.
Swimmers were able to get up close to a giant sperm whale at Leighton beach, just north of Freemantle
Marine biologist Dr Natalie Sinclair said swimming close to the whale was dangerous
The Department of Biodiversity, Conservation and Attractions (DBCA) Swan Coastal District Manager, Mark Cugley, said it may have to be euthanised because it couldn't get off the sandbar.
'If it is resting, whether it could actually get off the sandbar I'm not sure, but I would suggest over the last two, two-and-a-half days it's probably been looking for somewhere to come and rest up,' he told the ABC.
'That's what it's doing on the sandbar behind us at the moment.'
The department has also issued a warning to swimmers that the whale may attract sharks.