"I thought it was my friend playing a joke," McQuillen told ABC News.
The video shows him quickly retrieving the spear from the ocean floor just in time to fend off the 12-foot shark as it charged him again.
"The second time he came around, I thought I was finished," McQuillen told ABC News.
But after the shark's frightening head-on attack it circled back a third time.
As the shark swam closer, McQuillen lunged toward it and jabbed its side with the spear to keep it at bay.
"In a life-or-death situation, you need to keep your cool," he said.
Chris Plante, assistant curator at the Aquarium of the Pacific, said "the best way to avoid any shark encounter is to stay out of their area."
In this situation, Plante added, "This individual was in their area."
McQuillen is seen swimming in reverse for the remainder of the footage to get back to the shoreline about 50 yards away.
"I wasn't sure if I'd scared him off," he said.
When McQuillen emerges from the water at the end of the video, he lets out a cry of relief. He called the experience "f---ing gnarly."