The 34-year-old was competing in the final heat of a world tour event at Jeffreys Bay in South Africa's Eastern Cape province on Sunday when a looming black fin appeared behind him.
In a churn of water and spray, Fanning, a triple world champion, was knocked off his board as he battled to fend off the animal in images being shown live.
https://vine.co/v/e6ZO0dTw1JB
"It came up and got stuck in my leg rope," he said in a television interview after miraculously escaping unscathed.
"I was kicking and screaming. I just saw a fin. I didn't see teeth. I was waiting for the teeth to come at me as I was swimming. I punched it in the back."
His terrified mother was watching the drama unfold on television in Australia, and feared the worst.
"I was so scared. I just thought when that wave came through that he'd gone," mum Elizabeth Osborne told the Australian Broadcasting Corporation, adding that she went over to the TV "almost as though I could pull him out ... to save him".
Fanning lost his brother in a car crash almost 17 years ago and his mother said it brought back the memories.
"It's the worst thing I've ever seen happen to any of my family because it was just there in front of me," she said of the shark attack while fighting back tears.
"When Sean was killed in the car accident, I didn't see it. I saw this just in front of me. It was just terrible."
Fanning was pulled from the water by a nearby rescue jet-ski that rushed to his aid.
The World Surf League (WSL), which organised the J-Bay Open, said two sharks were spotted in the water near Fanning and his rival -- and close friend -- Julian Wilson, also from Australia.
Despite the danger posed by the shark, Wilson furiously paddled towards Fanning to help and was hailed in Australia Monday for his courageous actions.
His mother Nola, also watching on television, told reporters: "I don't know if he's crazy or a hero."
The WSL cancelled the competition after discussions with both surfers.
"Mick's composure and quick acting in the face of a terrifying situation was nothing short of heroic and the rapid response of our Water Safety personnel was commendable," it said in a statement.
Eleven-time world champion Kelly Slater was on the beach when the attack happened.
"I'm lost for words to be honest. We almost just watched our friend get eaten by a shark and I'm just blown away that there's no damage at all," he said.
While attacks occur periodically across the world, Australian seven-time world champion Layne Beachley said she had never even seen a shark during her decades in the water, highlighting the rarity of such events.
"I've been surfing for more than 40 years, I have never seen a shark or been intimidated by a shark -- intimidated by dolphins and whales, but not sharks," she said in Sydney.
"When we go into this environment we understand that this could potentially happen. But we have never seen this (in a pro event), this is unprecedented."
Craig Lambinon, spokesman for the National Sea Rescue Institute in South Africa, told ENCA television news that he believed "it is probably the first time that an incident like this at a surfing competition has been caught on camera".
Australian Prime Minister Tony Abbott, himself a keen surfer, said seeing a shark so close to a surfing contest was terrifying.
"I think all of us, we go out into the waves and we love to see dolphin fins, but if there's any doubt about what kind of a fin it is, it's pretty scary," he said.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ