I remember it the way I remember dreams: fragmented, illogical, surreal. I was a leader on a three-week youth expedition to the Arctic archipelago of Svalbard, in charge of 11 teenagers aged 16 to 18. We were camping on a flat spot in a boulder-strewn expanse of moraine near the mouth of the Von Postbreen glacier.

At 7.30am, I was woken by a scream. We scrambled with our sleeping bags, and my co-leader, Spike, narrowly beat me to the tent zip. There, metres away, was a polar bear, its white coat covered in dirt, its mouth spattered with blood. Spike shouted, either in terror or in an attempt to scare the bear, but it began running towards him. He cocked the rifle we'd stored between us as we slept. We don't know why, but it failed to fire. In seconds, the bear had knocked Spike to the floor.

Instinct and adrenaline carried me through the next few moments. I leapt out of the tent, wearing socks, leggings and a thin base layer. I picked up several rocks and charged towards the bear, sending a rock flying at its face, trying to entice it away from Spike, and from the gun.

My next memory is of the bear on me, staring me in the face for one brief moment, then swiping me with a giant, clawed paw. I remember its jaws round my head, its teeth in my skull, the sound of the cracking of bones, the blow to my left eye. I felt no pain, no fear, just a clear realisation that I was about to meet an unlikely and untimely death.

What happened next is a blur. The bear suddenly left me, and went on to attack two others. Then came my last crystal-clear memory. Spike – despite severe concussion and multiple skull fractures – lifted the gun and fired. The bear fell to the ground. My head rested on the legs of one of the teenagers, Horatio, and the dead bear lay only a metre or so down the rocky slope. I knew Horatio was dead, and I knew that was the worst nightmare for his family, his friends and any expedition leader. At 17, he'd been looking for the same formative experience I'd had on this archipelago nine years earlier. Coming back as a leader had felt like coming full circle. For Horatio, this should have been the beginning.

Spike and I owe our lives to the 10 other members of the group. With their friend's lifeless body lying in the middle of them, they remained composed and did everything right. They nominated one person to keep a constant eye on each of the casualties and administered first aid. They reloaded the gun and stood guard in case of other bears. They used the satellite phone to summon the helicopter rescue service.

I remember the sound of the helicopter circling overhead, and the group shouting and waving at it. I was strapped to a stretcher and carried off. Heavily sedated by strong painkillers, I have only fleeting memories of the next few days – the tiny hospital in Longyearbyen, the larger hospital in Tromsø on the mainland – and unaware of the front-page news story our incident had become.

Nothing could prepare my family and girlfriend for their first sight of me in the intensive-care unit at the Royal Sussex in Brighton. My left eye was blinded. My cheek and jaw bones were smashed. My face was swollen, marked from top-left to bottom-right by a deep cut. I came around slowly from the 12-hour operation that followed, and by the time I was transferred to a "normal" ward, the anguish over Horatio's death hit hard. I remembered how he'd arrived at the airport with his hand in a bandage and told me with a mock-sheepish expression that he'd cut it on a jam jar the day before. How he'd accidentally stuck his thumb and index finger together with superglue at base camp. His brotherly banter with his tent-mates. I could hardly believe he was gone, and that I'd been in charge.

It was the overwhelming amount of support that got me through – from my family, my girlfriend and, perhaps most of all, from the group. Three years on, we remain strong friends. We'll never forget Horatio, and will always regret his tragic death, but we also like to remind ourselves of our unlikely survival.

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