College Student Takes on Charging Shark - and Wins - After Stabbing It With Spear Gun

Tyler McQuillen credits his spear gun with saving his life.

One college student had a close encounter with a shark he will never forget.

Tyler McQuillen, 22, was swimming off the coast of Santa Barbara, California, in just 10 feet of water on September 1 when he "thought I was going to die."

Read: Diver Straddles Shark to Untangle It From Rope

He thought his friends were playing a joke on him by violently grabbing his fin, but the great white shark had chomped down on his toes.

After briefly dropping his spear gun out of shock, he was able to retrieve it, an action that may have saved his life.

He managed to capture the whole life-threatening situation on video as the shark charged. But McQuillen was able to hit the shark with his spear gun and it swam away.

“I gave him a nice little jab,” he said.

Read: Expert Gives Tips to Protect Yourself Against Shark Attack: 'Punch a Shark in the Snout, Grab His Gills'

With the shark's blood still on the tip of his spear, he swam back to shore as fast as he could to warn his friends, knowing the blood could attract other sea predators.

The bite broke two of his toes. He'll be on crutches for another month but when he's healed, he says he's looking forward to going back into the ocean.

Watch: Meet the Man Who Was Stranded as a Shark Lurked Nearby, Just Like Blake Lively in 'The Shallows'