An Australian man who climbed onto a dead whale as it floated offshore, attracting the attention of large sharks, has apologised for his actions.

The man climbed on the humpback, which appeared to have already been ravaged by sharks, south of Perth in Western Australia on Saturday.