A surfer has narrowly escaped death while taking on waves in a shark hot spot where the lives of two other men were nearly taken just one week beforehand.

The man was surfing off Western Australia's southwest coast near Gracetown, three hours south of Perth, about 5.30pm Monday when he was set on by a 3.5 metre shark.

He was just 15 metres from shore when the huge shark's tail swiped his foot, prompting a mad swim towards safety, WA Today reported.

Fellow surfer, Alejandro Travaglini, wasn't so lucky - he was surfing at the same popular surf break when he was mauled by a shark just one week ago.

A surfer has narrowly escaped death taking on waves in a shark hot spot where the lives of two other men, including Alejandro Travaglini (pictured), were nearly taken just one week earlier

Mr Travaglini was attacked about 8am while out with about five other surfers before suffering deep leg wounds from a shark about four metres long.

'I remember seeing the shark right in front of me and it turned around and pretty much opened its mouth,' he told the publication.

'All I could think of was "shove that board in its mouth, take that leash off and swim away".'

Hours later, another southwest surfer received deep gashes to his leg when he was attacked in the waves just two kilometres south.

Mr Travaglini (pictured) was attacked about 8am while out with about five other surfers before suffering deep leg wounds from a shark about four metres long

Signs warning beach-goers about sharks in the area have since been erected from North Point and South Point with fisheries officers attending the scene.

Organisers of the highly anticipated annual Margaret River Pro surfing competition were forced to cancel the event amid concerns sharks would threaten competitors.

The competition was due to be held Wednesday, but was canceled Tuesday following the two attacks on Monday.