IN the closing acknowledgements of Michael Pitre's terrific debut novel, there's a sombre line that brings you up short.

"A generation of Marines," it laments, "will grow old wishing we'd done better for you."

The compassion is heartfelt, and born of Pitre's own experiences. He served two seven-month tours of duty in Iraq with the Marines, in Anbar province, in 2006 and 2007. The "you" he addresses are the people of Iraq - the ordinary, faceless people who risked everything for the chance to live in a free society, cleansed of sectarian strife and untroubled by suicide bombs in market places.

Now, of course, three years after the last US service personnel quit Iraq, the country is in turmoil again. The grim fanatics of Isis (Islamic State) control large swathes of the territory. The chairman of America's Joint Chiefs of Staff believes Isis has an "apocalyptic, end-of-days strategic vision". Senior US Republicans want to see increased air strikes against the militants in Iraq and Syria, and fear that Isis is "the worst threat to the US since 9/11".

Indeed, when I meet Pitre, the world is still absorbing the news of the cold-blooded execution by Isis of American journalist, James Foley. As Pitre says: "You see that and you wonder, what century are we living in?"

The title of his novel, Fives And Twenty-Fives, is derived from a tactic routinely used by US convoys in Iraq and Afghanistan to avoid roadside bombs. If you're part of a convoy that comes to a halt, you stay in your vehicle and scan the dirt around the tyres for five metres in every direction in search of any hidden devices. You then get out and scan 25 metres in every direction to check for other devices. Five and twenty-five. "It became a metaphor," Pitre has said, "for protecting yourself both on the battlefield and at home."

The book is set in 2011, the very first year of the Arab Spring. It has three main characters: two former Marines (platoon commander Pete Donovan, a 2nd lieutenant, and medic Lester Pleasant) and Kateb al-Hariri, a young Iraqi who did some translating for their platoon, and who is now living in Tunisia. The chapters switch back and forth between them as they look back on their shared experiences in 2006, but the book is as much about Iraq as it is about the terrible emotional fallout that grips the characters.

It is a gripping, assured novel, conveying a vivid impression of the Marines' camaraderie as well as a sense of foreboding whenever they leave their base, never knowing when they will encounter enemy fire or roadside bombs. Or both.

Pitre also has an eye for a striking phrase, as when, on the very first page, Donovan dreams he is back in Iraq, running through the desert, and the Kevlar [the material used in combat clothing] around his neck "traps sweat and grime that froths into an abrasive paste". Moments later, a convoy detonates a hidden bomb - in Donovan's words, "the whole nasty serpent shrieks into life".

Pitre has said that although his experiences of Iraq were "pedestrian" in comparison with many Marines, he "had all of those same feelings of fear and shame, and guilt at times, I think are common to almost all veterans."

Pitre, it turns out, was one of the many Americans who signed up for military duty in the aftermath of 9/11. "I was 22 and in my last year at university. I was a very fit, adventurous young man. 9/11 happened. I didn't really understand how long the 'long war', as we now call it, would be, but I knew I didn't want to be 45 years old and to have sat this one out. I'd also gravitated to lots of military folks - people who were in officer training at university. They became my natural friends. So I used 9/11 as an excuse to join."

On his first tour of Iraq, he was a communications platoon commander, in charge of a platoon laying fibre-optic cable. On his second, he was the communications officer for a battalion as well as its night watch officer.

"From 8pm to 8am, I sat in the operations centre, on an old Iraqi Air Force base, and looked at monitors. There were radio operators on duty as well. When the battalion commander went to sleep, I was running the battalion. Every day I listened to the radio broadcasts that my friends on the supply convoys were sending back.

"I wrote all the After-Action reports for any time we fired off a flare, any time we had to do an escalation of force or fire off a couple of rounds into the pavement in front of someone who was coming at you. Any time there was a TIC - Troops in Contact- or any time we had someone wounded or killed and we had to have an evac[uation]. That was my job."

By the time Pitre left the corps in 2010 to study for an MBA, he was a captain. Aged 35, he now lives in New Orleans with his wife, Erin. He had, he admits, no plans to become a writer after the Marines.

"I'd studied creative writing in college. Most of my time at university was spent studying engineering but I changed my course study at the last minute to history and creative writing. We happen to live in New Orleans near the bar where the Masters of Fine Arts programme at the University of New Orleans meets after their writing workshops on Tuesday nights. I just became an interloper, because it's a fun crowd, and I made friends with them."

The novel began because he did not want to forget all his more uncomfortable stories about his time in Iraq. He started writing them down, one at a time. Erin read them but concluded that the characters were all the same. "There's a problem with your novel," she said. The final version underwent nearly a dozen drafts before Pitre was happy with it.

I bring up his evocative line about a generation of Marines growing old wishing they had done better for the Iraqi people. Is this something he felt in Iraq, or only later, once he had returned home?

"It's a feeling that came on this morning," he says. "You turn on the BBC news and see what's happening to the Yazidi refugees [trapped on Mount Sinjar after fleeing the Islamic State militants]. It's like, you want to do something. There was a time when I was 26 and had a shaved head and wore a uniform, when I was in a place to have done something about that. And when you see these IS pick-up trucks bouncing over the Syrian border … they're really proud of their flags and their rusted Soviet machine guns that they don't know how to maintain, and all you think is, man, we could just drop a bomb right on that truck."

In Iraq, the problem was trying to ferret out the insurgents from the general population in order to get a clean shot. "And here they are, just waving their flags, and you're like …" He winces, and shakes his head. "'Let me have one more shot.'"

Expressing the hope that the book does not make a fetish out of violence (it doesn't), Pitre makes some revealing points about the Marines' role, and sacrifices, in Iraq.

"The fighting, the killing and the dying done by US Marines in Iraq was not an end unto itself - we didn't go there just to do that. All of the fighting was incidental to the mission, which was the safety and security of the Iraqi people and the establishment of a democratic Iraqi state. That was the mission by 2005, anyway. If the question is, 'do you still feel that way about Iraq, do you wish you could have done more?', the answer is yes.

"One thing I hope people take away from the book is that the Iraqis you see on television - the Yazidis now, the people of Mosul, anyone living in western Iraq - these people have very real lives that are not unlike ours. A great many of them risked everything, and a great many of them lost everything, for the slim chance of having a Western state, a life that is free and at peace.

"The suffering that the US servicemen experienced in western Iraq? We asked for it. We raised our hands and emphatically volunteered. The people of Iraq? All of that was imposed on them."

Pitre is now working on his second novel, set in the last year of the American Civil War and the last year of Reconstruction. Nothing to do with Iraq, then? He smiles. "I think I'm done with Iraq, for the time being."

Fives And Twenty-Fives by Michael Pitre is published by Bloomsbury, 16.99