THE black flag of the Islamic State (IS) group still flies over the mediaeval minaret of the Grand al-Nuri Mosque in Mosul.

Ever since June 2014 the flag’s presence has signified the jihadists’ control of Iraq’s second largest city. Slowly but surely though the territory under IS control there is dwindling. These past few days, the US-backed offensive to push the extremists out of Mosul once and for all gained fresh momentum as an Iraqi Army armoured division advanced into the city from the north.

As the fighting intensifies, IS fighters find themselves besieged in the city’s northwestern corner, which includes the historic Old City centre and its al-Nuri Mosque with its landmark leaning minaret. For centuries the minaret has doggedly refused to topple, but the same cannot be said of the jihadists who occupy the bomb-shattered buildings that surround it. Most observers now believe that the days of IS in Mosul are numbered, their collapse imminent.

While the group will never entirely disappear and most likely resurrect itself in a guerrilla war across Iraq, it’s weakening has left many Middle East watchers pondering the future shape of the jihadist cause in the region and beyond. In this respect the significance attached to the recapture of the al-Nuri Mosque cannot be underestimated.

“It will be the flag on the Reichstag moment. It will allow victory over IS to be declared by the Iraqi government, their US allies and others around the world keen to see the end of the group,” says journalist Jason Burke, one of the world’s foremost writers on Islamic militancy for almost two decades.

As Burke recently pointed out in an article in Prospect Magazine, in six months to a year, IS will have lost any foothold, not just in Mosul, but also, it is likely, in Raqqa, the Syrian provincial capital 300 miles to the east which is now almost surrounded by another US-backed coalition, the Kurdish-led Syrian Democratic Forces (SDF).

As IS’s caliphate crumbles in Iraq and Syria, much attention is now being paid to what comes next for the jihadist movement. If recent comments by Iraq’s Vice-President Ayad Allawi are anything to go by then the possibility of an unlikely merger between IS and al-Qaeda might be in the offing. The two groups of course have never seen eye-to-eye, their differences leading each to accuse the other of treachery.

Only recently an IS magazine described al-Qaeda as “Jews of Jihad". Al-Qaeda leader Ayman al- Zawahiri meanwhile, has openly condemned his IS counterpart Abu Bakr al-Baghdadi since 2015, accusing him of having a negative effect on the jihadi cause and creating "fitna" or discord.

The operational approach of the two groups has at times been marked by significant differences.

Where al-Qaeda has worked to ingratiate itself with local populations, it has also issued propaganda presenting itself as a “moderate” alternative to IS’s indiscriminate barbarism.

Despite these differences there is of course no denying the great similarity in the ideology both groups pursue.

Perhaps it’s not surprising then that as pressure builds on the the global jihadi movement, that the leaders of both IS and al-Qaeda might consider some degree of rapprochement.

“The leaders and members of both IS and al-Qaeda believe in the same doctrine as well as having the same resources of jurisprudence. Both groups are committed to the principles of global jihad founded by Abdullah Azzam," says Hisham al-Hashemi, an Iraqi expert on jihadi groups.

Abdullah Azzam, also known as the Father of Global Jihad, was a Palestinian Sunni Islamic scholar, theologian and founding member of al-Qaeda. It was Azzam who became the teacher and mentor of Osama bin Laden.

Under Azzam’s influence, Bin Laden was persuaded to come to Afghanistan and help the jihad there during the Soviet occupation of the country in the 1980’s. But even given this common influence of Azzam on both groups, is a merger between IS and al-Qaeda really a possibility?

Many security analysts believe that the deep-rooted differences make any alliance between the two groups difficult at this stage. “I do not think there is any rapprochement on the level of understanding or military and security coordination … When one of the two leaderships fades away, only then it would be possible for one group to join the other,” says Hisham al-Hashemi.

With Bin Laden’s assassination marking the end of an era, IS came to dominate the global jihadist scene as the most feared Islamist-inspired terrorist organisation in the world.

But during the past few years, while the world has been preoccupied with IS, al-Qaeda, according to some experts, has been playing the long game. It has bided its time, regrouping effectively as IS bore the brunt of counter-terrorism measures in Syria and Iraq.

“While the world has been focused on IS, al-Qaeda veterans have been doing worryingly well," warns Jason Burke. "Partly in a deliberate bid to distance themselves from their upstart rivals, they have downplayed sectarian strife and stressed a desire to minimise Muslim civilian casualties. The strategy has paid dividends and al-Qaeda’s affiliates in Somalia, Yemen and, above all, in Syria are thriving."

This new al-Qaeda appears to be focused on consolidating long-term support in the Islamic world. In 2016 not only did the group defy expectations and manage to hang on, but since then has managed to gain some advantage by maintaining a low profile.

According to the US-based independent intelligence group Stratfor, al-Qaeda has done this by portraying itself as a moderate jihadist alternative to IS and viewing its struggle through the lens of an insurgent strategy and “long war". The end result is that al-Qaeda has been able to make inroads with militants at the local regional level.

Ironically in doing this, al-Qaeda has taken a leaf from the book of the counterinsurgency strategy employed as part of the US “surge” some years ago in Iraq to defeat it. By embedding with local populations, selling itself as less of a threat than IS, and relinquishing the scorched-earth tactics it had once employed as al-Qaeda in Iraq, al-Zawahiri has led his organisation to steady gains.

It was al-Zawahiri himself who expanded upon this strategy by releasing a “General Guidelines for Jihad” as far back as September 2013 that, among other things, called on al-Qaeda operatives, to “create awareness within the masses, inciting them, and exerting efforts to mobilise them so that they can revolt against their rulers.”

The guidelines cautioned too that al-Qaeda should avoid entering into an armed clash with Arab regimes unless forced to do so.

“Osama bin Laden’s strategy was always to ensure the West became embroiled in a regional quagmire, al-Qaeda would then counsel a low-key approach to jihad, one designed to secure bases of operation by working with local opposition and insurgent groups, hiding al-Qaeda’s nefarious hand by operating under other names,” explains Scott Stewart vice-president of tactical analysis at Stratfor.

Once these bases of operation were well established, influence could be used to continue prosecuting jihad against the “far enemy".

Jason Burke in his latest book, The New Threat from Islamic Militancy, agrees with this analysis. “This new al-Qaeda appears to be focused on building long-term support in the Islamic world. This may change. No-one has forgotten how 9/11 grabbed global attention. If al-Qaeda decides to target the “far enemy” – the west-rather than Islamic opponents – it will be well placed,” Burke warns.

This is a far cry from then US President Barack Obama’s claim in September, 2011, following Bin Laden’s assassination, that al-Qaeda was “on a path to defeat". Obama’s premature assessment was echoed by then Secretary of Defence Leon Panetta who insisted that the US was “within reach of strategically defeating al-Qaeda".

Far from being defeated, today al-Qaeda is very much a resurgent player on the global jihadist stage. By adopting its more covert approach, it has been able to expand while flying under the radar as the West and its Arab government allies have focused on IS.

In a July 2016 leaked audio statement mocking the US, Bin Laden's son Hamza proclaimed that although in 2001 the group was besieged in Afghanistan, it now had operatives in “Afghanistan and they have reached Syria, Palestine, Yemen, Egypt, Iraq, Somalia, the Indian subcontinent, Libya, Algeria, Tunisia, Mali, and Central Africa".

Both Syria and Yemen are perhaps where al-Qaeda has most profoundly made their mark in recent years. Spurred on by the gradual weakening of the Syrian opposition’s most moderate base, al-Qaeda spent much of 2012 to 2015 building the trust of Syria’s opposition under the guise of Jabhat al-Nusra, which means literally “support front". This was the first phase of al-Qaeda’s attempt to embed itself in the opposition.

“Al-Qaeda’s Syrian representatives – rebranded – as Jabhat Fateh al-Sham (JFS) in July 2016 and then renamed Hayat Tahrir al-Sham (HTS) after subsuming several other groups in January this year, have been relentless, and patient, in pursuing their long-term objective,” says Charles Lister a senior fellow at the Middle East Institute.

That objective can best be described as a merger of all armed Syrian opposition groups under its broad transnational Islamic umbrella – what al-Qaeda has commonly called a “uniting of the ranks".

All of this is a world away from the disorder and even disunity that is increasingly evident among the ranks of IS. In Yemen too it’s much the same story of al-Qaeda consolidating its gains. Yemen’s al-Qaeda franchise, al-Qaeda in the Arabian Peninsula (AQAP), has gained significant territory and support amid the chaos of the war there. The US-backed coalition in Yemen has fought it at times, pushing it out of a major port city last year, and the controversial US drone campaign against the group is ongoing.

Since US President Donald Trump entered office in January the US has significantly increased its bombing of al-Qaeda and other Islamist extremist targets in Yemen.

The Pentagon has confirmed that more than 70 drone strikes have been carried out since February 28, more than double the number of strikes in 2016. This however, much to the embarrassment of Washington, did not stop the leader of al-Qaeda’s branch in Yemen, Qasim al-Rimi, claiming they are fighting alongside US-backed coalition forces in the country. “We fight alongside all Muslims in Yemen, together with different Islamic groups,” he said, including “the Muslim Brotherhood and also our brothers among the sons of Sunni tribes.”

While al-Rimi did not elaborate on what he meant by “alongside” many Sunni tribal militias, these militias receive extensive funding and arms from the US-backed Saudi-led coalition, which has supported Yemeni President Abed Rabbo Mansour Hadi with air strikes and ground troops since March 2015.

If true, once again as in Syria, it demonstrates al-Qaeda’s ability to rebrand and merge with other groups under a broad Islamic umbrella.

US Defence Secretary Jim Mattis has described Syria as the “the most complex civil war probably raging on the planet at this time".

Yemen however has clearly given Syria a run for its money and Washington is learning the hard way that the line between adversary and ally is not easily drawn in Yemen. Indeed some even argue that the Trump administration’s involvement there is only helping al-Qaeda.

“The Yemeni branch of al-Qaeda is stronger than it has ever been,” the International Crisis Group warned recently in a report documenting the spread of al-Qaeda in the Arabian Peninsula.

“The first military actions by the Trump administration in Yemen bode poorly for the prospect of smartly and effectively countering AQAP,” the group concluded.

This weekend as the Iraqi Army opens up a new front in the battle for Mosul, IS is fighting for its existence in the city. Shortly it will be doing the same in the Syrian city of Raqqa. As IS continues to lose territory al-Qaeda only gains in strength.

“IS is brittle. Its so-called caliphate is a project of massive ambition and the group is weak as a consequence,” predicted Jason Burke some time ago. It would be a mistake to write off the veterans, al-Qaeda, in favour of the newcomers, IS he insisted. Burke’s prediction has been borne out. It’s not that that al-Qaeda is making a comeback, it’s simply that it never went away.