Shark warning
A shark warning sign posted on a beach in the northern New South Wales city of Newcastle, Jan. 17, 2015. Getty Images

A 14-year-old boy in Western Australia's Mandurah city punched a more than 6-foot-long shark to avoid a deadly shark attack Thursday. The boy was reportedly spearfishing off Avalon Point when the massive shark approached him.

Lucas Martin reportedly had only seconds to react as the shark approached him. The boy said the shark was most likely chasing the fish he had speared when it headed toward him.

“This shadow was fastly approaching me, and it actually turned out to be a shark,” he told local media. “I was really scared at that moment. I just (hit the shark) to its nose and it just went away.”

The teenager somehow managed to scramble up to the reef and upon arrival he warned others of the predator.

The incident took place at the same place where surfer Ben Gerring was fatally mauled by a shark in 2016. At the time, emergency services found it difficult to locate the spot of the attack on the Mandurah coastline and failed to save Gerring.

With the help of Gerring's brother Rick, authorities established emergency numbers placed on local beaches to avoid similar attacks.

Below are some tips as to how to avoid and survive a shark attack, courtesy Florida Museum of Natural History website.

1. Choose to swim in a group as sharks most often attack lone individuals. In case of fishing, try not to go away from the shore. Wandering too far from the shore could make it difficult to return fast for help in case a shark is spotted.

2. Avoid the water at night, dawn, or dusk as sharks are most active at these times.

3. In case of a cut, do not enter the water as blood attracts sharks.

4. Leave the water immediately if a shark is spotted.

5. Avoid going into waters containing sewage as it attracts bait fishes, which in turn attract sharks.

6. Don't splash a lot in the water. Erratic movements can attract sharks.

7. Avoid swimming toward a shark if it's seen in the water. Close encounters with sharks could turn fatal.

8. Do whatever it takes to get away after a shark attack.