In April this year, I was diving for fossils in Peace river in Florida, not far from where I teach marine science at a private naval academy. At 24, I’d been diving in the area for six years without any problems, and was guiding the dive for two friends, including Jake Koehler, who films videos of his underwater finds for his YouTube channel, Dallmyd. Because of the danger from alligators, we’d usually drop anchor on a particular spot, and bang on the boat and throw rocks to disturb them, as they tend to avoid contact with humans. But we hadn’t got much on film that day, so we decided to take a chance and do something unusual: instead of staying in one area, we jumped in the river and drifted backwards with the current.

I drifted into a very narrow channel, about a quarter of a mile ahead of the others, wearing my usual scuba gear: a gas tank, a lifejacket and weight belt. I suddenly felt an intense pressure on my left ankle, and, for a split second, I thought it was Jake messing about. We’d been joking earlier that my black wetsuit made me look like bait – the other two were wearing camouflage wetsuits. But then the pressure became unbelievably intense, and I realised it was a gator.

He was already twisting me like a corkscrew as he dragged me to the bottom, in what I knew as a marine biologist was a death roll – almost always lethal. My survival instinct kicked in: I’ve never known such mental clarity. The water was only 8ft deep, so I inflated my lifejacket, and kicked with my free leg towards the surface, dragging the gator with me. I could feel him pulling my leg down, and it felt as if I was being ripped in half. As we broke the water, I saw he was around 8-9ft long, his tail lashing in a frenzy as he tried to roll with me again. I knew that if he took me back down, he would twist my foot off.

Unlike victims of a shark attack, most people attacked by gators drown rather than bleed to death; my scuba gear had bought me valuable time. But my biggest fear now was that my regulator, which delivered air, would be ripped out of my mouth, or that I’d become trapped beneath a rock or the roots of a tree.

I hammered the gator’s head with my free foot as hard as I could, but his jaws were clamped around my ankle with a force equivalent to that of a T rex. I understood that I would only be able to free myself if the gator tried to get a better grip on me with a bite readjustment, so I kept hammering, forcing him to reposition. The pressure on my ankle eased for just a second, and I took my chance. When his jaws clamped down again, this time he got a mouthful of my flipper. Kicking with all my strength, I got my foot out of the flipper and swam for my life to the riverbank.

Gators don’t like prey that makes their life difficult, so he didn’t pursue me. I sat panting on the bank in shock, waiting for my friends to surface. His teeth had ripped through two layers of my wetsuit, cutting deep into my flesh, but it was the crush injury that caused the most damage. My ankle was twice its normal size.

When my buddies surfaced five minutes later, they had no idea what had happened. Between them, they helped me back to the car, which was parked an hour away, and took me to hospital. Astonishingly, nothing was broken. The doctors said I’d make a full recovery. Medics came from all over the hospital to take a look at me: gator attacks are surprisingly rare, with fewer than 400 recorded in Florida over the past 70 years; few people survive a death roll.

Jake posted the aftermath of the attack on YouTube, and, a week later, another diver contacted me, saying he’d found my bright-yellow flipper. The bite marks were massive – it made me realise what a close call it had been.

I don’t blame the gator: I was on his turf, and I disturbed him. The attack hasn’t put me off diving; I was back in the river again a few weeks later, posting my adventures on Instagram at @thinkseek – though now I’m careful to stick to an area I’ve already scouted. It’s important to me that young people in particular recognise that we humans are just one part of an extraordinary natural world, and that we can out-think these magnificent predators without destroying them.

• As told to Tess Stimson

• This article was amended on 9 September 2019. An earlier version referred to “oxygen” in a breathing tank rather than air.

Do you have an experience to share? Email experience@theguardian.com