It was back in 2005 when I first visited the Iraqi town of Tal Afar.

By then the city’s notorious reputation was already well established.

Situated on a smuggling route in the north-western desert of Iraq, near the Syrian border, it was known to be a toxic mix of Islamist extremism, insurgency terrorist infiltration and inter-ethnic tension.

Al-Qaeda in Iraq called the shots back then and the town was largely in the hands of its hard-core Iraqi and foreign jihadis.

Tal Afar’s stone fortifications and narrow alleys had a haggard look about them. It was a suspicious, threatening place, full of checkpoints - and where shops remained shuttered, with townspeople peering warily from front doors and gates.

While there as a correspondent embedded with the US Army’s 3rd Armoured Cavalry Regiment and the 82nd Airborne Division, I was told a terrible story that epitomised Tal Afar’s reputation.

It concerned a 14-year-old Iraqi boy who had been kidnapped from his family and press-ganged into service by a cell of Islamist insurgents operating in one of the city’s Sunni neighbourhoods.

During questioning by the Americans after his capture, the boy told how he had been raped and abused by the insurgents, before being given the job of holding down the legs of victims they beheaded.

Throughout the traumatic period of his detention by some of the most uncompromising and barbaric fighters in Iraq, the only reassurance the boy was ever given was that of promotion - that he himself would one day become an executioner.

With Tal Afar again in the news, I couldn’t help thinking about that boy and his story. Where is he now I wonder? Might he be safe and sound, rebuilding his life far from the town? Or, has he once again been swept into the jihadist ranks, this time of the Islamic State (IS) group, that have held Tal Afar for almost three years now?

Following the protracted military campaign to retake Mosul that ended just a few weeks ago, the Iraqi Army supported by US air strikes and Special Forces have now turned their attention to ousting IS from Tal Afar.

While militarily progress on the ground is said so far to be good, there are concerns, as in Mosul, of the number of civilian casualties that the offensive will cause. It’s estimated that there are roughly 2000 IS fighters inside Tal Afar, along with between 10,000 and 40,000 civilians. But as the battle for Mosul revealed, such numbers are difficult to verify.

According to statements from the Iraqi Joint Operations Command (JOC) issued over the last few days, Iraqi forces have continued to encircle jihadists holding out in the city.

Within the city limits, Iraqi forces captured three more neighbourhoods at al-Nour and al-Mo’allameen in the east and al-Wahda in the west, taking over several strategic buildings in the process.

“The Iraqi flag has been hoisted in al-Nasr district,” an eastern neighbourhood of the city, the JOC said in a statement.

“The troops are now at the entrance to the district of the citadel,” which dates back to the period of Ottoman rule.

Though much smaller than Iraq’s second largest city Mosul, some 40,000 troops are taking part in the fighting. These include, three Iraqi Army divisions, Iraqi and US-led coalition special forces personnel, as well as “government-backed” paramilitary fighters who operate under the umbrella name of Popular Mobilisation Units or Hashd al-Shaabi.

Anyone trying to understand the myriad groups participating in the fighting, face something of an alphabet soup in terms of names and acronyms across the region right now.

But the makeup of Hashd al-Shaabi matters enormously. Among their ranks are militias like Kataib Hezbollah (Hezbollah Brigades), Moqtada al-Sadr’s Saraya al-Salam - the current incarnation of the Mehdi Army - and the Badr Organisation.

Very significantly too there are also fighters of Asaib Ahl al-Haq trained by the Iranian Revolutionary Guards’ Quds Force that has been accused of a number of kidnappings and attacks in Iraq.

Sitting just some 35 miles to the west of Mosul, Tal Afar has been described as a ‘vipers nest,’ because the other side too in the shape of IS has long since lodged some of its hard core jihadist fighters there.

Kurdish officials I spoke with over the last few days in Erbil, the de-facto capital of the Kurdistan Regional Government’s (KRG) autonomous area in the north of Iraq, said the course of the battle to retake Tal Afar by the Iraqi Army will become apparent quickly and will go one of two ways.

“After their defeat in Mosul, [IS] will perhaps put up less resistance, but maybe, they have forces there that the Iraqi Army (IA) will find tough indeed,” said one Kurdish official.

Following the months-long and bloody battle for Mosul, it’s now reported that the IA suffered considerable casualties, perhaps seriously depleting some of their crack US-trained counter-terrorism units that bore the brunt of the fighting inside Mosul.

If this is the case then the Tal Afar offensive will prove another testing ground as will another IS stronghold much further south, the town of Hawija, that has been encircled by the IA and for some time.

In a strange twist to the Tal Afar story, reports emerged last week that the current US National Security Adviser Lt Gen H.R McMaster was in great part responsible for convincing US president Donald Trump, that the US should now beef up it military presence in Afghanistan.

It was reported that Trump’s decision to “stay the course” in Afghanistan was a result of McMaster using a 1972 photo of Afghan women in miniskirts to show the president that the country had once adopted Western values and to persuade him to escalate the war.

Those who have encountered McMaster would doubtless recognise this unorthodox approach, one that made him such an effective counter-insurgency tactician, when as a then Colonel back in 2005 during my embed, he commanded the US Army’s 3rd Armoured Cavalry Regiment in Tal Afar.

Aside form Trump’s obvious fickleness, McMaster doubtless made a persuasive argument for once again upgrading US military deployment in Afghanistan.

While long seen by some within the Trump administration as being soft on Islamist extremism and terrorism, McMaster’s military track record shows he is anything but.

Interviewing him back then, I found him to be articulate, considered, possessing a PhD in American History. McMaster was a charismatic soldier, one quite different to many US officers I’d met before in Iraq. It was during that time too that he went on to lead something of a landmark counter-insurgency operation in Tal Afar that became a blueprint of sorts for other operations of its kind in Iraq.

A consummate military man who didn’t suffer fools gladly, the recent departure of Trump’s right-hand man, White House chief strategist, Steve Bannon, is said to have been in part a result of him not seeing eye-to-eye with McMaster.

Today, 12 years on from McMaster’s command of that operation in Tal Afar, the US military still remains embroiled in the fate of the town.

Tal Afar has long been an obvious target for US counter-terrorism operations, given that it has produced some of IS’s most senior commanders and was cut off from the rest of IS-held territory in June.

For many in the region, Tal Afar’s residents are not viewed as helpless victims. For a relatively small population, security sources say a disproportionate number of men from the city filled the ranks of IS as commanders, judges and members of their vicious religious police. For precisely this reason, human right groups are concerned about the potential for revenge and reprisal killings as the town is taken.

The Hashd al-Shaabi paramilitary Shi’ite militias, have been heavily involved in the Tal Afar campaign and may wish to make an example of the predominately Sunni town that has for so long been a hub for IS.

There is good cause for concern following many reports of torture and extrajudicial executions after the taking of Mosul by the Iraqi Army.

Of less importance in terms of size compared to Mosul and with the Iraq authorities making media access more difficult, there are fears that innocent civilians might bear the brunt of some of these reprisals, away from the headlines.

Before it fell to IS, Tal Afar’s population of 200,000 was predominantly ethnic Turkmen, a Turkic people who have their own language and customs. The majority were also Sunni Muslims. The inter-ethnic tension that has plagued Tal Afar in the past is once again a feature of its fate.

Already a delegation from the UN Human Rights Council is expected to arrive soon near the town to monitor the human rights situation. Others too are watching events unfold in Tal Afar with a mixture of apprehension and hope.

The Turkish narrative was clear from an article in the country’s Daily Sabah last week.

“The United States is fully behind the Iranian-backed Shi’ite paramilitary group Hashd al-Shaabi in its quest to take full control of the Turkmen-populated Iraqi town of Tal Afar in defiance of staunch opposition by the Turkish government,” the article claimed, adding to the ethnic volatility.

All of this of course creates a combustible situation on the ground once Tal Afar is taken.

North of Tal Afar too are the positions of Kurdish Peshmerga, who having contributed to the offensive against IS in Mosul along with the Iraqi Army, are now themselves braced for an IS backlash in their own territory, and are almost equally wary of the Hashd al-Shaabi militias.

“A few months ago this was the frontline between the Peshmerga and IS, now we have Hashd al-Shaabi, and already we have had a few problems with them,” one Kurdish Peshmerga Colonel, told me, as we stood on the sandbagged emplacements last week at the devastated predominately Christian town of Batnaya, just north of Mosul and some 60 miles from Tal Afar.

“Believe me when I say it will only get much worse between us,” he added.

For others, the battle for Tal Afar has an altogether different significance. Among them are members of the region’s ethnic Yazidi population, who cling to the hope that hundreds of loved ones sold into slavery by IS in 2014 will be found in Tal Afar. The town has always been identified as one of the centres of IS activity where many ‘slaves’ were incarcerated. Estimates range from several hundred to a thousand.

When Tal Afar does fall it will not of course mean the end of IS. There is still the encircled town of Hawija to be taken. This may see the military campaign to defeat the jihadists in Iraq and Syria ending territorially in the Euphrates River valley area between the Syria-Iraq border and the Syrian city of Deir al-Zour.

“The campaign to defeat IS ends in what we characterise as the middle Euphrates River valley,” British Army Maj. Gen. Rupert Jones told reporters on Wednesday in Erbil. Jones is deputy commander of the coalition’s military operations in Iraq and Syria.

Pushed as they have been from Mosul, and with Tal Afar and Hawija now in the line of fire, the largest concentration of IS forces are now believed to be in the area of the 93 mile long stretch of the Euphrates River from al-Qaim in Iraq through to Syria’s Deir al-Zour

“That is where the military defeat will be completed,” Maj. Gen Jones predicts.

Terms like 'victory' and 'defeat' however, are relative in this region right now, and mean different things to different people.

Speaking last week the Kurdish commander of the Peshmerga forces in west Kirkuk, Kamal Kirkuki, explained how he saw IS in the months and perhaps years to come.

“They have even set up an organisation for post-IS named Fajrulazeem,” said Kirkuki, explaining that the group work as sleeper cells, active in the Sunni villages and cities.

“They have changed the way they operate: kill, inflict harm, and disappear,” he insisted. “IS is rebranding itself.”