When Australian schoolboy Angus Chapman felt a tug on his leg while playing in the sea, he thought it was his sister messing about.
But when he took a closer look, it turned out a shark was trying to take a bite out of him.
Angus, 15, punched the shark and got back to the shore, even though his leg was badly hurt.
He was flown to hospital, where he had a big operation and is expected to make a full recovery.
The shark attack took place on the remote Cocos Islands in Western Australia.
Angus told reporters that if he hadn't punched the beast, he feared he would have lost his leg.
It's been suggested that a bronze whaler - one of the angriest sharks in the sea - might have got Angus.
But some local people think that it was barracuda fish that attacked.
Shark attacks are rare and, even though he's had quite a fright, Angus apparently loves the ocean so much, he can't wait to get in the water again.