I first heard the name "James" on the front, east of Fallujah. It was a late morning in March, the sun was high but shrouded behind a one-dimensional layer of cloud. A cold grey light fell on Al Anbar's level landscape, the desolate farms and abandoned crops, sucking the colour out of the greens and accentuating the drabness of the huge earthen berms the Shia fighters had bulldozed up in lieu of trenches.

Anbar looked more miserable than usual, even in spring. It was only ever harsh at the very best of times, and these past 12 years had been hard.

Faith flowed smoothly with war over those shrapnel-tilled fields, pictures of Shia religious leaders adorning the fighters' every vehicle and bunker, while among the volunteers a group of smiling, turbaned clerics mingled, there to give spiritual sustenance to the men.

The front was relatively quiet that day. Since being shot and kidnapped in Syria last year, "relatively quiet" is about as hard-core as I am up for, at least for now. The fluidity of the previous summer's fighting, when Islamic State - aka Isis or the Daesh, an Arabic acronym preferred by its opponents - had rampaged unchecked across northern and western Iraq, had gelled, settling into an attritional phase of bloodshed in which each side raided the other across fixed front lines that were defined by increasingly complex sets of fortifications.

© PA Photos

To the north, in Saladin Governorate, a painfully slow Iraqi offensive was under way, grinding away at Islamic State fighters holding Tikrit. As Iraqi government forces there were shoehorned forwards, block by block, by coalition air strikes, it seemed that Islamic State might, at last, be in decline as their earlier battlefield fortunes waned.

In Baghdad, diplomats and senior coalition officers began to talk about the "turn of the tide", and promised that the days of Islamic State's deceptional feint, manoeuvre and battlefield triumph were over. They spoke of 6,000 Islamic State fighters killed by coalition air strikes in the space of just seven months, a body count that supposedly included half the organisation's leadership cadre. Some even told me that if the Iraqi government so wished, the operation to recapture Mosul could begin before the summer. They told me this to my face and I believed them. I think they believed it themselves.

Yet only two months later, Islamic State was to spring forwards again in a blitzkrieg advance, capturing the city of Ramadi, provincial capital of Anbar, behind a rolling wave of suicide attacks that shattered the Iraqi Army lines, allowing just a few hundred Daesh fighters to rout their more numerous foe.

© PA Photos

All that lay ahead. Nevertheless, even "relatively quiet" had its drawbacks on that stretch of the line in Anbar that day in March. An Islamic State sniper hidden in the vegetation a couple of hundred yards the other side of the berm took a shot that punched dead centre into the chest of one of Brigadier Saeed Hamid al-Yasser's sentries, snapping him back off the lip of the berm. He was wearing a flak jacket but, even so, the force spun him down into the sand and made him kick and drum his heels like a man hanged on a short rope.

The other fighters gathered around him and scooped him up. By the time he managed to suck some air back into his lungs he had been frogmarched into the brigadier's forward headquarters, just back from the base of the berm.

He was a young guy, the shot man, rangy and colt-like, and his eyes shone with the dazzled wonder of surprise salvation. His comrades crowded him, keen to hold him close and poke their fingers in the hole in the front of his chest plate, hoping a bit of his luck might rub off on them.

"Thanks be to God he was wearing his flak jacket!" the brigadier mused as he prodded the plate, apparently as surprised by the man's professionalism in choosing to wear it as by his survival. "I lost four men in one day to a sniper here. None of them were wearing their flak jackets."

He was an instantly likeable figure, Brigadier al-Yasser. He had a refreshing sense of humility but an unstated sense of edge, too, so that it would have been a mistake to underestimate him. There was, however, nothing especially martial in his outward appearance.

Short and slightly chubby, in his early forties, he was originally a teacher and community leader from Muthanna Governorate in Iraq's southern Shia heartland. Responding to the fatwa of Grand Ayatollah Ali al-Sistani, the most revered Shia religious scholar in Iraq, the previous summer he had travelled northwards at the head of a unit of 2,600 Shia volunteers, named Ansar al-Marjaeya, to join the fight against Islamic State on the lines east of Fallujah.

Across Iraq, four divisions of regular troops had collapsed and fled, abandoning their positions almost without fight. At Sistani's behest these Shia "Popular Mobilisation Units", the al-Hashd al-Shaabi, filled the breaches they left behind, giving their commanders a key share in the overall future of Iraq.

Not since the Iran-Iraq war had so many thousands of Shia volunteers gathered beneath the pennants of their faith, the green and black flags of Imam Ali. They had converged to fight in a war theydescribed as a "jihad" for the defence of their faith, against Islamic State and the Sunni extremists who were fighting a jihad for the expansion of theirs.

Islamic State had always been strongly represented in Fallujah, one of its original breeding grounds, so that in the months since it arrived there the brigadier's scratch civilian force had to learn how to fight against some of the most hard-bitten Daesh units in Iraq, and his casualties had been predictably heavy.

A fortnight earlier he had lost 22 men in a single Islamic State assault, most killed by a double suicide attack on his position.

Noticing my interest pick up as he described the fight, he showed me footage of the attack originally taken by one of the sector's surveillance cameras, later downloaded onto a phone.

The ruthless precision of what I watched epitomised Islamic State's tactics. First, given cover by heavy machine-gun fire, an armoured Islamic State bulldozer emerged from the tree line, impervious to the Shia fire ranged upon it, and cleared a lane to the Shia berm.

Next, in co-ordinated turn, two captured Humvees packed with explosives sped down the lane; the first detonated to blow a breach in the berm through which the second moved, exploding just in front of the brigadier's headquarters, while in the wake of the latter blast an assault group of Islamic State fighters charged forwards, among them sappers laden with pre-rigged charges. "I was blown through the air but survived," the brigadier murmured, pointing to the footage of the mushroom cloud enveloping his HQ, the same trace of wonderment in his voice that I had earlier noticed in the shot fighter's eyes.

In the desperate fight that followed the two blasts, all the Islamic State fighters were eventually killed, but only after they had penetrated deep into the Shia lines and caused havoc. The last men died only after they had seized a vehicle, then lost control of it and crashed head on into the brigadier's pursuing pick-up, the pile-up survivors scrambling out of the wreckage and blasting away at each other point-blank in a final meltdown of jihad furore and road rage.

I asked if foreign fighters were often identifiable among the Daesh dead. It was a lazy question, for the front in Anbar province was already a well-known magnet for out-of-area volunteers to Islamic State. Earlier that month eight foreign fighters, including a Russian, a Belgian and an Australian - 18-year-old Muslim convert Jake Bilardi - died in a co-ordinated series of suicide attacks on Iraqi positions in Ramadi, the same day that Brigadier al-Yasser lost his 22 men.

He rattled off a familiar roll call of Saudis, Libyans and Tunisians in reply, adding that his fighters found the occasional African among the dead Daesh, and on one occasion discovered two dead Australians and a German convert. Then he caught me by surprise. "We killed one of yours the other day!" he said, clearly amused. "A white British guy. His name was 'James'."

James! Most of the Brits who joined the Daesh were clone replicas of one another, as mutually transposable in their names, age, origin and influence, right down to their plastic-gangsta roots and faux faith lingo, as to warrant little individual interest, no matter how often they were billed as "coming back to a street near you".

The security services in the UK have estimated that more British Muslims have joined Islamic State than are currently serving in the British Army. (In June, a 17-year-old became Britain's youngest suicide bomber, reportedly having joined Islamic State before blowing himself up in the northern town of Baiji.) The route to their ranks was well-trodden. Until Turkey belatedly tightened up its border controls last year, most prospective jihadists entered Syria through southern Turkey, using exactly the same route as the small cadre of reporters who had worked in Syria. Among ourselves we nicknamed the flight from Istanbul to Hatay, in Turkey's south, the "jihad express", due to the volume of foreign fighters we saw aboard.

Most of the Brits reached their ­destination in Syria unmolested, blowing their cover only when they started tweeting their jihad ­experiences. Rarely among these British ­jihadists was there ever a glimpse of an ­educated mind and evolved ideology­, although foreigners joining Islamic State ­included veteran fighters as well as skilled radical ideologues.

Instead, the British volunteers seemed uniformly similar: disempowered, disillusioned young Muslim men whose rage, frustration or sense of meaninglessness was given a portal by Islamic State on a journey of dark-star self-revelation. The product may have been radical, but the roots were usually utterly banal. "James" suggested something very different. "James", a name favoured by British royalty, a Christian name with Latin and Hebrew history, carried all sorts of connotations. James, I mused, was possibly a wayward public-school boy who may have taken a very wrong turn on his gap-year travels. Whatever his true identity, he was certainly worth checking out. So I asked the brigadier to take me to the dead man's battlefield grave.

He grumbled for a while, as it seemed that it was some way away.

But his sense of irony was tickled by the thought of the dead Briton and, after a few minutes' discussion, he agreed to take me to the resting place of James, the dead British Daesh.

We have killed a few from the UK, but this is the first British I remember who was white," the brigadier elaborated as we drove away from his headquarters into the flat, lush vista of ruined farms and abandoned crops, bisected by canals and irrigation ditches. "We even marked his grave so that your people can collect him."

Earlier he had shown me welfare boxes sent to his unit by a class of seven-year-old school girls in Uruk, a city in Iraq's Shia south.

Asked by their elementary school teacher to bring something from home to send to the brigadier's volunteers, each girl donated a heartfelt gift: a 7.62mm Kalashnikov bullet. "I had mixed feelings when I opened the boxes that arrived from these little girls," the brigadier murmured, jingling the rounds between his fingers in the open boxes.

"I was delighted that they thought of us in our time of hardship," he continued as, outside, across berms and tangled crops, the sound of heavy machine-gun fire rolled along the line. "But I was sad that small fingers, better used for pencils, chose to hand us ammunition."

I think he really meant it, too. The al-Hashd al-Shaabi defied easy generalisation. Some of their militias really were little more than expanded Shia death squads - thugs in uniform whose idea of a quick thrill was killing a Sunni or, even better, torturing one to death. Yet other Shia commanders led disciplined units of relatively skilled fighters, and understood that if Iraq had any future as a cohesive entity, then it lay in reconciliation and sectarian accord between Shia and Sunni communities.

Expanding this theme as we drove to find James' grave, the brigadier pointed out the overgrown fields, left behind by fleeing Sunni farmers, in which lay overripe squash, potato and tomato crops, unmolested by his fighters' forage parties.

"We don't even take their fruit and crops," he assured me, insisting that his men were under strict orders from Sistani not only to preserve Sunni property and prevent the abuse of Sunni civilians, but also to bury slain Daesh fighters with respect.

"We know that if we mistreat the Sunnis they will all run to the hands of the Daesh," he added. "If all of our Sunni brothers lose faith in our government, then we will have war here until the end of time."

Yet other Shia units I encountered had long, dark track records of running death squads against the Sunnis, as well as entrenched relationships with Iran. Although they shared a common enemy with the US in the shape of the Daesh, beyond it their intent and aspirations differed wildly, so that the war had become as much about internal Iraqi politics, regional power games and the greater Shia-Sunni standoff as a fight to remove Islamic State from Iraq.

Each of the three principal Shia militias involved in the battle for Tikrit that month - the Badr Organisation, Asa'ib Ahl al-Haq, and Kata'ib Hezbollah - was vehemently pro-Iranian and anti-American, and to some or other extent all had the blood of Sunni civilians on their hands.

Head of the anti-Isis Shia Badr Organisation, Hadi al-Amiri. © PA Photos

Hadi al-Amiri, the head of the Badr Organisation, was a grizzled, enigmatic man I met on the east bank of the Tigris outside Tikrit. He made no secret of his close friendship with the commander of the Iranian Quds Force, Qasem Soleimani, who was an archenemy of the US and probably the most influential special forces commander in the Middle East. "He was my guest and provided us with tremendous help, unlike the Americans," Amiri told me. "We can rely on Qasem Soleimani every time."

Despite recent forays into political moderation, Amiri remained shadowed by his ­reputation during the earlier era of Iraq's sectarian bloodshed. In December 2009, a US diplomatic cable from Baghdad, part of the Wikileaks trove, alluded to a claim that between 2004 and 2006 Amiri had ­personally ordered attacks on Sunnis.

Meanwhile Asa'ib Ahl al-Haq, which had boasted of conducting 6,000 attacks against US and British forces during the occupation and was responsible for the 2007 kidnap of British IT expert Peter Moore along with his four bodyguards, held positions along the same stretch of Tikrit front line.

Its commander, Qais al-Khazali, had been arrested in an SAS raid in 2007, but was later released from jail as part of a protracted negotiation for Moore's freedom.

The third member of this leading troika of Shia militias fighting in Tikrit, Kata'ib Hezbollah, had been added to the US State Department list of foreign terrorist organisations in 2009, and even as it fought in Tikrit, it was in the middle of issuing repeated threats to shoot down coalition aircraft that flew over its positions.

Given such sinister allies, Brigadier al-Yasser seemed fatalistic as he discussed the possible cost of shouldering Sistani's orders for restraint and discipline. His own willingness to accept coalition air support also put him at odds with other Shia units.

During a top-level meeting the previous month in Baghdad with the Iraqi prime minister, Haider al-Abadi, attended by various Shia militia commanders, the brigadier said he had repeatedly insisted on the need for Iraq to embrace its friendship with coalition countries. "We are defending the world from the Daesh, and our religious council has said there should be no barrier in asking for help from friends, including the coalition," he told me.

Such frankness did not go down well with other Shia commanders there. "At the end of the meeting the prime minister shook my hand as I left and warned me quietly, 'Be careful your friends do not get you killed.'"

Suspected Isis militants are kept in captivity at a refugee camp in Amiriyat al-Fallujah, 18 miles southeast of Fallujah in Iraq, by security forces, 13 June 2015. © PA Photos

We drove on in silence for a few minutesuntil a couple of desert grouse suddenly scurried across the track ahead of us. Slamming on the brakes, the Brigadier grabbed his M16, leapt to the ground and shouldered the rifle.

Already he seemed far too gentle to survive the war, and I was sure he had not the skill required to hit either bird as they scurried away through the crops: blurred, low-profile targets, well-camouflaged and moving fast through cover. I winced inwardly at the inevitable humiliation that was about to follow...

He fired just one round. It was a perfect shot and it nailed a scurrying grouse dead on the spot. Noticing me gawp with surprise, the brigadier turned to me and grinned as one of his fighters ran to collect and pluck the dead bird. "Don't go thinking I am just a teacher who doesn't know how to shoot."

James had died in the obliterated tangle of a village named al-Rafush. The journey there with the brigadier had taken the best part of an hour across earthen tracks, and included unnerving expanses of deserted landscape, heavy with vegetation, which my imagination populated with ambush parties and IEDs.

Anbar had always given me the heebie-jeebies, ever since I was first embedded with US Marines in Fallujah in 2004. That time, the Marines were in action in a failed attempt to bring the city back under control after four US Blackwater contractors had been killed, burnt, and the bodies of two of them hung from a bridge over the Euphrates.

I was in Anbar again later that same year after US troops finally did manage to crush the resistance in Fallujah, and had returned a few more times across the intervening decade. It was never anything less than mean, with levels of violence that usually far exceeded those of any other province in the country.

The last time I had been in Ramadi, the provincial capital, in 2012, a Sunni sheikh had pointed to the place in his garden at which a suicide bomber tried to detonate himself during a tribal gathering. The sheikh and his entourage had flailed around the flower beds in a desperate wrestle to keep the young man's fingers from clicking the detonator, until finally someone had produced a pistol and shot him in the head. Unsure of how best to defuse the man's suicide vest, they elected to chuck him in a canal and throw grenades at him until he properly exploded.

Then there was the memory of an American padre in Ramadi, who had confided to me in 2005 that he was struggling to hold himself together while giving the last rites to dying soldiers, describing how he had often walked away from stretchers sobbing. He said that a brother priest there had abandoned the cloth because he could no longer contain his desire to kill.

Iraq's largest governorate, Anbar province was ever a bastion of Sunni resistance. Expanding westwards from Fallujah right up to Iraq's borders with Syria, Jordan and Saudi Arabia, along its north-eastern flank ran the river Euphrates, which rolled down the map on a long, winding journey to join the Tigris in the Shatt al-Arab, far to the south.

The Americans almost lost control of Anbar entirely during the savage fighting there of 2004-2005; in all, more than 1,300 US soldiers died in the province during the occupation. Paradoxically, it had also been the scene of one of the Americans' biggest successes in Iraq. In late 2005 leading Anbari sheikhs, unnerved by the savagery of the extremist ideology imported to the province by foreign fighters, had begun to turn their tribesmen away from attacks against the Americans, to target the radicals instead.

The Americans encouraged this local uprising by the so-called "Anbar Awakening", otherwise known as the "Sons of Iraq", and co-ordinated their own troop surge with the Sunni tribal forces, eventually routing the Islamic State of Iraq - the Daesh's forebears - from Anbar.

However, in the years since US troops left Iraq in 2011, the situation had fallen apart again as the juggernaut of sectarian loathing rolled unchecked through Iraqi Shia and Sunni communities, cleaving them one from another during the tenure of the then prime minister, Nouri al-Maliki, under whose rule sectarianism had flourished.

Already discriminated against by the de-Baathification purges that had accompanied Saddam's downfall and their loss of power in Iraq, the Sunnis were further antagonised by Article 4 of Iraq's contentious anti-terrorism law. Repeatedly abused, Article 4 skewed the definition of criminality, and was cited time and time again to justify the mass arrest of Sunnis, as well as the detention of Maliki's political opponents. Eventually, late in 2012, a series of Sunni protest camps was established in Anbar, which spread further across Iraq in response to the alleged rape of a Sunni woman in jail and the arrest of a prominent Sunni politician's bodyguards.

Demanding an end to human-rights abuses and sectarian prejudice, which they felt made Iraq's Sunni population second-class citizens, the camps became the focus of violence after dozens died when Iraqi security forces clashed with Sunni protesters in the town of Hawija in April 2013, an incident that ignited a surge in sectarian killings across the country.

Meanwhile, across the border in Syria, the revolution had turned to civil war. This further refracted Iraq's Sunni-Shia divide through a prism of divergent sectarian interests, as Iraqi Sunni volunteers crossed the border to serve with the rebels, while Shia militias journeyed to Damascus to fight alongside the regime.

© PA Photos

So, by the time Islamic State rolled into the Iraqi city of Mosul in the summer of 2014, most Sunni communities already either loathed or feared the Baghdad government, and regarded Islamic State as the lesser evil of a limited choice. Fallujah had been captured by Islamic State months earlier, in January, and the government held only a few quarters in Ramadi, Anbar's capital, ahead of the city's complete fall to Islamic State this May.

James had died fighting in December, serving with the Daesh in the middle of this Sunni-Shia conflagration, his life ended by an air strike that had blasted apart the house he was defending against an assault by the brigadier's fighters, who had crossed a nearby canal complex in boats at dawn supported by coalition jets.

The ferocity of the fighting had completely destroyed al-Rafush, transforming the village into piles of rubble and shredded beams, and the dry soil beneath our feet rang with shrapnel shards, bullet casings and broken glass. Amid the wreckage lay scattered the remnants of some Isis fighters: leg bones, frizzled beards and bits of skull, too blasted apart to bury. As we stomped around the rubble I noticed the air still reeked of ash and decayed flesh, three months after the battle.

Elsewhere amid the devastation, though, Brigadier al-Yasser and his men had been good to their word, and shallow graves marked the final resting place of dead Islamic State fighters.

Among them, James' grave was unique. Curious at the pale European corpse, the brigadier had personally supervised his burial. A shredded set of chest webbing, a blast-twisted flak jacket and a bent Kalashnikov magazine had been used to mark his tomb. So certain was the brigadier of James' nationality that he ordered his men to place a sign beside it, believing that one day British authorities may wish to repatriate his corpse. "Tomb of the British Daesh James", it read. "He was in his thirties, and had ID on him," the brigadier remembered, as we stared at the chest webbing and ravaged flak vest. He described finding what seemed to be a British driving licence on James' body. Recalling only the corpse's first name, he said that he had obeyed orders by wrapping the ID card in a nylon bag, before placing it on the dead man's chest and shovelling the soil on top of him. Next, he had written a letter to his senior commanders in Najaf mentioning the grave's location, and suggesting that they should contact the British embassy and have James' body repatriated.

In vain, I pestered him to remember James' surname, but it eluded him. Considering the great pyramids of Iraqi dead raised over the previous few months, I was not altogether surprised that he could not recall a foreigner's second name, especially one written in alien script. One of the Shia fighters there suggested digging up the body to read the driving licence, but we quickly ditched the idea: whoever James was and whatever he had done, he deserved the peace of the earth.

The brigadier collected his thoughts for a moment. "If the British do come one day to collect James, they should not seek compensation or revenge against us," he said finally, grinning at the war's ironies in that ravaged village. "After all, he was a Western man and killed by Western jets."

Then we walked back to the vehicle, leaving James, his story and his lonely grave behind us.

© PA Photos

I never did discover James' full identity.

He was certainly mentioned in correspondence between Shia commanders in Anbar and their headquarters in distant Najaf. The British embassy in Baghdad said it had never heard of him, but also mentioned that it would not investigate reports of a British citizen's death unless it knew their full identity and had received a direct request from the family to repatriate the body.

The Iraqi Ministry of Foreign Affairs, by contrast, told me that the Ministry of Interior in Baghdad had a list of all dead foreigners, including British citizens, killed fighting for Islamic State in Iraq. However, it refused to share its details.

Elsewhere, in another Baghdad office, a flustered Iraqi official in a suit pulled out a muddled box of files concerning some, but not all, of the dead foreigners in Iraq, and told me that among them was a letter sent from London, written by an "interested party", referring to the grave of a dead British Islamic State fighter in Anbar whose nom de guerre was "Abu Barra", but not "James".

The Shia fighters on the front certainly believed they killed a white British convert named James in al-Rafush. As far as I know his grave marker remains there to this day, although the original, its lettering bleached out by the sun and wind, has since been replaced by one spelled with the phonetic "Jeems".

Perhaps, after all, it is best that the mystery of James, the dead British Daesh, is never resolved. Dead men don't tell tales, after all. Some, though, like James, at least tell you fragments of a story you might not have ever heard if they had remained alive.

Follow British GQ on Twitter: @BritishGQ