One moment author Michael Scott Moore was in a car seated next to a gunman assigned for his protection and trundling down a dusty road in Somalia. The next, in a surprise attack, he was grabbed from the vehicle, attacked, bundled into a car, taken to a secret location and held for a ransom of $20 million (Dh73.4 million) by a pirate gang – the very people he was in the country to write a book about.

In what would be one of the longest detentions by kidnappers, the gang would hold the journalist in the east African country for a lingering 977 days even as his mother — aided by FBI experts — would be negotiating with the captors for his release. During that time, Michael’s immune system would collapse, as would his hopes of ever seeing his family again.

‘Of course, I was scared, particularly at first,’ says the author in a telephone interview with Friday from his home in the US. ‘I wasn’t sure that I wasn’t going to get killed.’

That he survived and wrote a book on the ordeal, The Desert and the Sea: 977 Days Captive on the Somali Pirate Coast, published by HarperCollins last year, is proof of the man’s sheer grit, determination and fortitude.

Looking back, the threat of kidnapping hung over Michael from the moment he landed in Somalia in early 2012. Moving around almost always in the shadow of armed security personnel, the journalist, who had received a grant from the Pulitzer Center for Crisis Reporting to research piracy, went about gathering information and conducting interviews for a book he was writing about the history of piracy in the Horn of Africa.

To keep himself occupied, Michael would compose entire paragraphs for his unpublished books and commit them to memory. The Desert and the Sea: 977 Days Captive on the Somali Pirate Coast is memoir of his nearly three-year captivity by Somali pirates

‘The trial of a pirate gang that had been captured when they attempted to hijack a German cargo vessel was on in Germany at the time,’ says the author, who holds dual citizenship of America and Germany. He felt a book that discussed the case and some lesser known aspects of Somali piracy could help bring the issue into focus, while stoking a debate on solutions to a problem that was threatening marine traffic off the East African coast.

Little did he know that he would have more than firsthand experience of what it meant to be taken hostage by pirates.

Ten days into his stay in Somalia, and pretty much done with the interviews, Michael was tying up some loose ends and getting ready to return to the US to finish his book.

Meanwhile, American filmmaker and photographer Ashwin Raman, who had completed his assignment in Somalia and was put up in the same hotel as Michael, was preparing to return home. Believing it would be safer to accompany the security personnel hired for their protection and see off Ashwin at the airport than remain alone in his hotel room, Michael hopped into a car.

It wasn’t that the route to the airport was safe – a few months earlier, two aid workers had been kidnapped for ransom while they were travelling on the same road. But it was while returning to the hotel that Michael’s life would take a dangerous turn.

Seemingly out of nowhere, a pick-up truck mounted with a gun approached their vehicle and in a burst of action, a dozen gunmen sprang out of the truck, pulled out Kalashnikovs and began firing shots into the air. One of them forced open the passenger door and while dragging a struggling Michael out of the vehicle, thwacked him on the head with a rifle butt. In the melee, the kidnappers also broke his wrist and knocked off his glasses, leaving the then 43-year-old author struggling and disoriented. Bloodied and in pain, Michael was dragged and shoved into a waiting car that sped off down a potholed mud track into the desert brush.

The author who was in Somalia to write a book about piracy has just been kidnapped by pirates.

‘At that time, I had no idea who’d kidnapped me,’ says Michael. ‘I didn’t figure out which Somali clan was holding me.’

While he feared for his safety, he also knew how serious a liability he would end up for his family. ‘The first thought was how much of a burden it would be on my family; that was the thought that came to mind instantly,’ he says.

That thought would be on top of his mind for the next two-and-a-half years of his harrowing captivity in Somalia.

All through those weeks and months, his mother would negotiate with the kidnappers who would frequently move their captives (apart from Michael there were two other hostages, both in their 60s, who the gang had kidnapped at different times) from one place to another to avoid detection by the authorities.

‘We were held at several places,’ says the 49-year-old, recollecting what was perhaps the most traumatic period in his life. If their holding room for the first few days was a rundown villa by the seaside, for several months after it was aboard a ship anchored off Somalia – from where Michael would make a futile bid to escape, but more about that later.

‘Initially, the captors were not friendly at all,’ he says. ‘Especially the boss who was in charge of the kidnapping. He just liked to hit people.’

Right after the kidnapping, Michael and the other captives were kept in one house for a long period of time, but later, partly because aerial surveillance had increased, the kidnappers kept moving them frequently from one prison house to another. ‘Those were miserable houses. I make them sound fancy in the book calling them pirate villas. But while they were certainly houses that pirate bosses wanted to build, they weren’t complete yet.’ Largely concrete shells, the villas were barren inside with no furniture or any facilities.

‘Initially, the captors were not friendly at all,’ he says. ‘Especially the boss who was in charge of the kidnapping. He just liked to hit people.’

But the guards who were assigned to keep an eye — and the muzzles of their guns — trained on him, were slightly more humane. ‘Among the guard gangs I dealt with were a few who were friendly. But I didn’t build up any such relationships with them until maybe months into my captivity.’

While the captives were forced to sleep on the cement floor, their diet was usually a loaf of bread and a can of tuna with a bottle of water to wash it down. ‘On rare occasions we would be served pasta or rice,’ says Michael.

One thing that was a constant, though, was fear, particularly during the initial days of the kidnapping. ‘At first I was scared. I felt I might be killed at any time,’ says the author of the 2010 novel Sweetness and Blood. ‘I knew that pirates tended not to kill their hostages but I also knew that there were accidents all the time.’

Once it began to sink in that he had been kidnapped, the writer began plotting an escape plan. ‘The first time the thought of escape occurred to me was within the first 10 days or so into my kidnapping,’ he says. ‘We were moved from one camp to another and one time we were in a sort of wooded valley; that was the first time I noticed a possible escape route.’

But that hope was dashed — armed guards were watching over them 24/7 and he knew that any move to escape could be dangerous, perhaps even fatal. ‘So I shelved any plan I had and kept waiting for a more propitious moment to occur.’

What were the thoughts that kept you alive, I ask Michael.

‘That’s an interesting question,’ he says, pausing for a long moment before answering. ‘The fact is that I didn’t maintain hope and I guess that was the way I survived. Hope was a problem and hope is something that the pirates try to maintain. They would say “You’re going to go free in a week” or “You are going to go free in a month.” And that was something I was stupid enough to believe at first.’

The pirates’ promises would get Michael’s hopes soaring only for them to come crashing down once the time period mentioned by the kidnappers elapsed. ‘That was extremely destructive. After a while and going through these cycles a few times I realised I’d have to detach myself entirely from that cycle of hope and despair. That’s the only way I could maintain any sort of equilibrium.’

But living without hope was not easy because ‘I had to stop thinking about the future entirely’. And that was not what he wanted to do. So despondent and demoralised was Michael by the end of the second year in captivity that he wasn’t sure he would ever see his family and friends again.

‘There were all kinds of ways I could have died. I knew that even if something good happened, like a military rescue, there was a good chance I could get killed. Or I’d die of neglect. Or of skin infections or that sort of thing as my immune system had kind of collapsed. So for my own peace of mind I assumed I’d never get to see my family and friends ever again. That was actually the only way to move forward.’

He found that getting his hopes high was causing him more mental anguish. ‘If I thought too much about the future then I began to feel desperate. Sometimes I felt that if I did manage to escape that would just be a bonus of sorts.’

Nevertheless, he had his ears tuned to the skies. ‘While I was on the ship, the sound of a helicopter was a source of comfort,’ he says. ‘On land, any kind of plane or drone – and I heard quite a few drones – made me feel that somebody knew where I was. If it was a plane’s sound, I felt I needed to brace myself for who knows what’s coming.’

If the sound of aircraft wafted in at night, he would experience ‘a mixture of fear and hope. I’d think someone was coming looking for me but [there was also the chance that] they might come blasting in and kill me.’

As for the pirates, fly-by aircraft got them scared and panicky and they would quickly begin plotting the next course of action.

Staying sane in a situation that did not seem to have an end in sight was clearly a challenge and one way Michael tackled the situation was by thinking about working on books that he had in mind. ‘I know that does sound strange, because I was not thinking about the future. But [thinking about writing] did keep me occupied.’

He had a lot of books unfinished and he would go through the manuscripts in his mind, composing entire paragraphs and committing them to memory.

‘Every morning I’d go through these paragraphs almost like an actor going through their lines. I also had lists of all the men in the ship that I was held on. I’d written down everyone’s names; it was difficult to spell because they came from five different countries.’

Michael wrote down the names on a piece of cardboard, which he lost when the pirates brought him to land. ‘ [When I was freed] and I started writing my book, I managed to find the ship’s manifest so I checked the spelling against my own memory. So really these memory games kept me occupied.’

Ashtanga yoga was another thing that kept him occupied once he was back on land. The guards, though, found it extremely amusing to see Michael do the headstand or the downward facing dog. ‘They thought it was hilarious. They initially tried to imitate me, practising some of the positions with me just to make fun of me. They kept it up for a few weeks [and I would] adjust their poses and tell them how to do it the right way — which makes me perhaps the only yoga teacher in the world to Somali pirates.’

Did they allow him to maintain a diary?

‘Yes, sometimes,’ says Michael. ‘I had my notes confiscated twice and I learnt quickly that if I wrote about what was happening, the pirates got paranoid. The third time I got my hand on pen and paper, I was careful. The guards would check for their own names and place names, and as long as I was not writing that they allowed me to keep my notes.’

Michael then began drafting a novel. ‘They couldn’t understand why I was writing a made up story. But I left Somalia with six notebooks.’

But even while he was writing his novel, he was also considering ways of escape. ‘I planned to jump off the ship I was being held on, timing it with any helicopter that would be flying in the vicinity,’ he says.

That moment did not seem to come, until one night he found a chance when the ship’s anchor chain snapped. ‘That triggered chaos on board,’ he recalls. ‘A surveillance plane came to actually check out the ship that was drifting freely. It took only about 20 minutes for the plane to get there so I knew someone, probably Americans, knew where I was.

Deciding to escape via sea under the cover of darkness, he came up with a story and requested to go down to the work deck. ‘A guard accompanied me but when I noticed he didn’t have a gun, I realised it was my chance.’

Leaping into the sea he began swimming away from the ship. ‘I thought the ship would keep going and I would have to just fend for myself, maybe wait for a rescue or swim to land,’ he says, his voice soft and gentle. Unfortunately for him, ‘the ship seemed to [drift] towards me… tilting towards the direction I was swimming. I didn’t expect that’.

The pirates turned on searchlights and easily spotted him, after which they threw a lifebuoy for him. The only option for him was to get back on the ship. ‘The next morning the pirate boss came into my cabin and, yes, he beat me for trying to escape.’

Clearly traumatised by the extended kidnapping saga, he is still picking up pieces of his life. ‘How has it changed me? It took two years and eight months out of my life. Being able to live without hope or expectations for the future is a major readjustment and maybe more than I realised at that time.’

The journalist says that although he was in captivity for over a quarter of a decade, he never experienced symptoms of Stockholm Syndrome — a condition that causes hostages to develop a psychological alliance with their captors as a survival strategy during captivity.

‘I think it didn’t happen for the simple reason that at some point in my captivity I managed to forgive the guards. That’s not the same as identifying their interests as my own. But it did help me maintain a certain amount of personal integrity and it maintained that separation which was also an act of peace.

‘I think that helps. If I had not gone through that transformation something in me would have snapped. Then Stockholm Syndrome would have been a little more possible.’

All the while Michael’s mother was busy negotiating and raising the ransom amount, requesting family, friends and the publications he worked for, among others. But nothing came from the government, besides ‘logistical support, and the FBI offered advice on negotiation for my release.’

Michael hopes his book will focus more attention on piracy. ‘I think piracy as such has fallen off on the Somali coast. But the pirate gangs are still together. They are not just disgruntled fishermen, they are organised criminal gangs into other kinds of business.’

The author is working on a fiction novel at the moment — ‘something I started writing while I was in Somalia.’

Michael’s book, published by HarperCollins, is available on Amazon.