The battle to oust Islamic State jihadists from Iraq's second-largest city, hailed as the capital of their self-proclaimed caliphate, has begun in earnest. In the first of two dispatches Foreign Editor David Pratt reports from the key frontlines in the advance towards Mosul.

IT was an apocalyptic sky. The thick plumes of black smoke spiralling upwards had settled into a dense blanket hovering ominously over the town of Qayyara.

“Daesh have set fire to the oil wells, the smoke lets them hide from the coalition warplanes and their bombs,” a masked Iraqi soldier tells me using the commonly used Arabic acronym for the jihadists and pointing to the sky.

Occasionally a fireball punctures the curtain of soot-black smoke as another powerful bomb from the US led coalition airstrikes detonates on its target inside the town.

It’s hard to imagine anyone or anything surviving such an onslaught and inferno, but the IS fighters are well dug in, many sheltering in underground bunkers and tunnels from which they appear ghost-like to offer fierce resistance.

Time and again their snipers take a deadly toll on Iraqi troops, as do their suicide truck bombers. Over days during the battle for Qayyara, one after another they hurtle their vehicles laden with tons of explosives in the direction of the advancing Iraqi troops, near a key bridge in this oil town that lies on the western bank of the Tigris river.

“Quick, quick, this way,” urges an Iraqi military policeman, ushering me and two journalist colleagues into a bullet-scarred building just 800 yards from the bridge.

Seconds earlier on the other side of the road from where we are standing a mortar shell fired by IS had slammed into the ground, momentarily kicking up a puff of yellow dust from the earth parched by average temperatures of 45-48 degrees Celsius.

The oven-like heat takes its own toll on the fighters of both sides, but this has not stopped IS from fighting hard for Qayyara until it fell to the Iraqi Army last week.

As the Iraqis tightened their noose on the town the pressure clearly began to tell on the IS cadres. Qayyara residents who fled to neighbouring Kurdish controlled Makhmour, told of the jihadists hunt for alleged spies and deserters and how the beheadings and extrajudicial executions that previously were occasional became commonplace.

In all Qayyara’s loss will be a big blow to the jihadists who have exploited the town’s oil wells for revenue for the past two years. It will, however, be a huge tactical gain for the Iraqi Army.

With the help of US Special Forces they have been able to secure Qayyara’s airbase from which they can launch and support operations as they close the 60 km gap that lies between them and their ultimate objective and prize, Iraq’s second largest city, Mosul.

Last Thursday on Qayyara’s outskirts a convoy of US Special Forces vehicles could be seen lumbering along the shell-scarred highway between the town and neighbouring Makhmour, out of which the Iraqi Army advance on Mosul is headquartered.

The stiff resistance put up by IS around Qayyara is typical, too, of the other most fiercely contested frontlines that include towns like Gwer and Khazir that sit in this part of Northern Iraq.

All three places are at the sharp end of the huge ongoing military offensive by the Kurdish Peshmerga and Iraqi Army to rid Mosul of IS fighters who have made it their self-proclaimed capital for the past two years.

Like Aleppo, its counterpart city in neighbouring Syria, the outcome of the battle for Mosul will have a profound impact for the people and politics of Iraq the region and further afield.

Some even maintain that this is a battle that could mark the death knell for the jihadists of IS, whose terrorism has shocked the world far beyond the frontlines of Iraq.

For the moment though there is little sign of them vanishing any time soon on these battlefields where up close and bloody the fight for Mosul is being viciously contested.

Assim Ahem, along with his fellow Kurdish Peshmerga fighters, Ahmed Mehsin and Yusef Aziz, know all about getting up close to their IS enemies.

The three young men recounted how they had entered an IS tunnel on the Gwer frontline near to the village of Kanash.

“We moved along till we came to a kind of chamber where there were signs that four Daesh had been hiding,” said 25-year-old Assim Ahem, as we talked on the Gwer bridge, already badly damaged after being fought over for months.

“Inside we saw their bedrolls, cooking utensils and weapons,” Ahem continued. Slung round his neck was an Egyptian-made Port Said and Akaba submachine gun, which he had looted from the IS lair.

It was only on discovering that the tunnel had not actually been vacated by the IS fighters and the three Peshmerga realising there was a large bomb rigged to explode should the tunnel be overrun, that the three soldiers decided to back out of the tunnel.

As we talked they told me that having returned to the frontline after a short rotational break, this time they were determined to clear IS out of the same tunnel, but that many of their comrades were reluctant to join them on such a dangerous mission.

According to the Peshmerga whole swathes of territory around the Gwer bridge is thought to contain IS tunnels. In some instances narrow pipes leading to the Tigris have been found through which IS fighters pumped water into their undergrounds redoubts which they used for washing or softening up the bone dry soil to make it easier to expand the digging of their subterranean network.

Almost every scrap of territory that has been occupied by IS along these frontlines is littered with booby traps and bombs left behind by the jihadists, making any advance a nerve-wracking and painstaking process.

Outside Qayyara one Iraqi officer warned us that many of the areas through which we were moving had not yet been fully cleared, even though many civilians could already be seen returning to their damaged homes.

IS’s use of tunnel systems has become widespread on the frontlines of Iraq and Syria. In villages only just liberated around the Khazir district frontline Peshmerga fighters took me through a neighbourhood in which a warren of tunnels had been discovered.

Here and there in what remained of the buildings where IS had been holding out, they had smashed holes in walls to enable them to move house to house while holding their positions.

Clambering through the bomb blasted houses, the unmistakable stench from the corpses of IS fighters still lying beneath the rubble wafted sickeningly around us. Everywhere there were the tell-tale signs of their presence before airstrikes and artillery fire had eviscerated their existence.

In one room I came across the wooden shoulder stock of a Kalashnikov assault rifle blown apart from the rest of the weapon. In another, a charred shoe with what remained of a human foot still inside.

One room contained heaps of documents including a poster produced by IS explaining why television satellite dishes were haram or forbidden under Islamic law.

It was a strange proclamation given that the jihadists themselves have made full use of television and social media technology for propaganda purposes.

“This is one of their tunnels we have yet to enter,” a fighter told me as I was led into the room of one building where a semi-circle of protective sandbags still sat around the entrance to the tunnel.

Peering into its blackness it was impossible to tell how deep down it went or what lay inside, but according to the Kurdish fighters it was doubtless, like most other tunnels, rigged with booby-trap bombs.

Many such tunnels are inhabited by IS snipers, who the Peshmerga admit have posed a particular problem to their advance towards Mosul.

“We have lost 12 men to their snipers right here on the Gwer bridge frontline over the past few weeks,” confessed Lieutenant Pola Dishad, as we stood a week or so ago behind some of the sandbagged emplacements overlooking the Tigris and IS positions in villages on the far bank of the river.

Inserted at intervals among the sandbags are ballistic-proof glass windows through which the Peshmerga can view the IS positions a few hundreds yards away.

Almost without exception each of these ‘windows’ has been hit by sniper rounds leaving a web of cracked glass and bloated puncture marks where fortunately for those on this side of the line the bullets have failed to penetrate.

Some IS snipers are known to have sophisticated weapons and equipment. On the Gwer frontline one young fighter showed me a photograph he had taken on his mobile phone of IS sniper gear they had found in one tunnel system.

While the weapon was missing, the sniper had left behind his camouflage ghillie suit, which when worn resembles a character from some zombie horror movie but is very effective in helping blend into the surrounding countryside.

The obvious dangers aside, conditions for the Peshmerga and Iraq Army troops manning these frontlines positions can be tough. Temperatures are near unbearably high and on average in August around 45 degree Celsius.

While on the Gwer frontline near the river, fighters said that swarms of mosquitoes had made sleeping difficult despite being exhausted from the fighting.

As engineers worked almost round the clock to repair the Gwer bridge, their heavy earth moving bulldozers uncovered other dangers too including snakes and scorpions.

Peshmerga fighters I spoke with however were determined that none of these frontline challenges and obstacles should slow their advance on Mosul.

At his military base dubbed Black Tiger camp, near the frontline town of Gwer, Major General Sirwan Barzani, nephew of the current Kurdish President, and commander of the Gwer and Makhmour frontlines, spoke of the timescale and what he expects will be the key challenges for his Peshmerga forces as they draw closer to Mosul city itself.

“The problems we face are much the same as those we have faced over the past year only more intense, IEDs, suicide truck bombs, but more and more we understand the tactics of Daesh,” says Barzani.

“The Peshmerga know how to fight in the mountains but fighting on the flat was new to us and this enemy, Daesh, is unbelievable and they have come from all over Syria, Iraq and beyond and with new weapons.”

The willingness of IS fighters to die in suicide attacks, he says, makes them a very difficult enemy to defeat.

Speaking of one recently-thwarted suicide truck bomb attack he says his soldiers subsequently found 10 tons of explosives on board the vehicle.

Like most Peshmerga he is somewhat disparaging towards his allies in the Iraqi Army whose advance he insists is much slower than theirs.

“In my opinion the most important point is that many of their soldiers have no loyalty to the Iraqi Army.”

Barzani says that while the Iraqi Army have weapons, equipment and budgets “one hundred times better” than the Peshmerga, they lack the morale and belief of his men and in many instances there is a failure of trust within their own ranks.

Such bad feeling bodes ill for this unholy alliance between the Peshmerga and Iraqi Army, but Barzani remains optimistic about the timescale of the Mosul operation maintaining that the city itself could fall by October.

Securing the rest of Ninevah Province, in which Mosul sits, he admits is a very different proposition given that the area is the most complex in terms of ethnic, sectarian and tribal makeup in Iraq. Failure also to strike the right political note in the wake of the Mosul campaign could so easily tip Iraq into civil war.

For his part Barzani believes that when Mosul falls it will not be the end of IS and instead the group’s spectre will continue to stalk Iraq albeit in another guise and under a different name.

Other senior frontline Peshmerga chiefs, including General Najat Ali who commands the Makhmour front, echo General Barzani’s views.

Not only does he believe that the inadequacies of the Iraqi Army poses a problem for the future advance on Mosul, but says that IS itself, far from being pushovers, will put up resistance that could see the campaign to liberate the city of over a million and a half people run well into next year.

How long then before Mosul will be liberated, one month, two months, three months, I asked?

Pausing for a long time before replying he eventually came straight to the point.

“Really IS remains strong, it’s not weak as some people suggest,” the general said candidly. “Still they fight, they die to defend”.

The battle for Mosul is now well under way, but a long and tough campaign lies ahead and the fighting on the frontlines will only become more intense.

Militarily Mosul will be a tough nut to crack, and Iraq will most likely be a very different place in the wake of the battle to retake it.

Next week in the second of his frontline dispatches, David Pratt reports on the massive humanitarian crisis looming alongside the battle for Mosul.