A surfer is recovering after being knocked unconscious by a whale just off Bondi Beach.

Bishan Rajapakse was with a group of surfers around 40 metres offshore on Sunday morning when the curious whale swam up to them.

The 38-year-old doctor had been peering into the mammal's eye when it slapped down its tail, striking him on the head, the Sydney Morning Herald reported.

bishan rajapakse knocked out by whale

The whale gambols with surfers shortly before slapping Bish on the head with its tail

Rajapakse - known as "Bish" - told The Australian: "Some other surfers were quite close to it and I remember wondering to myself about that tail - I thought 'Wow, this could just go and knock us all out'."

Lifeguard Anthony Carroll told the channel: "The whale has lifted his tail and it's come down and struck the (surfer) on the head and knocked him out."

bishan rajapakse knocked out by whale

Bish, pictured in hospital where he was treated for head and shoulder injuries

Bish was carried to the shore and taken to St Vincent's Hospital where he was treated for head and shoulder injuries.

Speaking to ABC, Bish described the experience as "mystical", adding he had asked the whale "How's it going?" before he was struck.

And he likes to think the whale responded by "giving the board a high five".