Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

Part 5 in a Series

Donald Trump was elected to president on a platform of politics not as usual, so it is fitting he inherits a world in flux. Post-World War II rules are dying, old alliances shifting and traditional roles shed. While Trump is a giant question mark on the world stage, NBC News’ Chief Global Correspondent Bill Neely looks at major international challenges the president-elect faces upon inauguration on Jan. 20.

Iraqi army soldiers celebrate as they hold an ISIS flag they captured during a military operation to regain control of a village outside Mosul on Nov. 29. Hadi Mizban / AP

LONDON — Donald Trump could not have been clearer on the campaign trail: He will crush ISIS, and President Barack Obama’s war against the extremists is "a disaster."

But it’s also clear the next president will have to face some hard facts about the world’s deadliest terror group.

The defeat of ISIS in Mosul, Iraq, by U.S.-backed forces will not spell the end of ISIS and destroy it throughout the Middle East.

It cannot stop followers in the U.S. and the rest of the West from trying to commit mass murder.

It also will not stop its fighters returning to the U.S. or Europe from carrying out atrocities.

Defeating ISIS in Mosul and its Syrian stronghold of Raqqa certainly does not deal with what gave rise to the militant group in the first place — anger among millions of the world's Sunni Muslims.

Former U.S. Secretary of State Henry Kissinger has warned extremists like ISIS may have an incentive to provoke a new president to a reaction that undermines America’s global position.

"They may make the assessment that Trump will react to a terror attack in a way that suits their purposes," he told The Atlantic magazine.

So the president-elect has a problem and ISIS is already planning.

Discontent and Resentment

The group has announced what it will do in the event that it loses Mosul where it is battling a U.S.-backed coalition — temporarily retreat into the desert. This is what its predecessor al Qaeda did after it was driven out of Iraqi cities during the U.S. surge in 2007.

The new president might be tempted to think ISIS has disappeared. But retreat is not defeat.

It was perhaps easier Obama to wage war on a group holding land, its so-called "caliphate" in Iraq and Syria.

It is harder to wage war on "terror" and on a death cult’s ideology that can inspire violence in New York City and New Delhi.

The most immediate challenge for Trump is the danger of blowback — the threat of a revenge ISIS strike on the U.S. As the phrase goes, "if you take a bat to a beehive, prepare to be stung by the bees you don’t kill."

The medium-term challenge is to lance the boil of Sunni discontent and resentment so Muslims are never again attracted to beheading, mass slaughter and suicide bombings as a way of solving political issues.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

And in Iraq especially, the problems that created Sunni extremism have not gone away. ISIS sprung from the rage of Sunnis at the sectarian bias of Iraq’s Shiite-dominated government.

Sunnis may once again rise up against misrule from Baghdad, unless Trump helps forge a new order in Iraq. And the same is true of Syria, where the Arab Spring began with a Sunni revolt against the Alawite clan that surrounds the family of President Bashar al-Assad. Many, including the French Prime Minister Manual Vals, are convinced this struggle against militant Islamist extremists will last a generation.

The global challenge extends well beyond the Middle East, where ISIS has inspired loyalty from deadly terror groups like Boko Haram in West Africa and Abu Sayyaf in East Asia.

It has trained thousands of militants from the U.S., Canada, Europe and Asia who may return home and bide their time until the moment they can wreak revenge for their dead caliphate. In short, the jihadi dream of a Muslim empire will most likely live on after ISIS disappears.

While Trump and many policy makers have focused on ISIS, another old threat has not gone away: al Qaeda.

The group's leaders are still committed to attacking the West. AQAP (al Qaeda in the Arabian Peninsula) remains a deadly threat. Al Qaeda's leader, Ayman al-Zawahiri, says the priority is still to strike America “until it bleeds, militarily and financially.”

So 15 years after al Qaeda's Sept. 11, 2001 attacks on the United States, Zawahiri continues to evade the Navy Seals who hunted down and killed his boss Osama bin Laden.

And in the Middle East, its offshoot Jabhat Fatah al-Sham is still a player in the Syrian war.

Financial Support

Beyond the immediate challenge of ISIS and al Qaeda, Donald Trump faces the diplomatic and policy dilemma of what to do about extremist groups' supporters in U.S. allies in the Gulf such as Saudi Arabia and Qatar.

Sunni Saudi Arabia and Shiite rival Iran have been at the heart of this problem by fueling proxy struggles that inflame sectarian struggles throughout the region. These conflicts only feed extremists like ISIS and al Qaeda.

America's ability to pull levers in Saudi Arabia, which has criminalized financial support for extremist groups while continuing to export a profoundly conservative version of Islam, has diminished as has its relationship with the kingdom.

Its reliance on the Saudis for oil is shrinking by the month as shale production rises in the U.S. In 2015, the nuclear deal with Shiite Iran enraged Sunni Saudi Arabia, which was already angered by Obama's unwillingness to back the Syrian opposition and what they saw as Bush's disastrous invasion of Iraq.

Related: Young Prince Shakes Up Ultra-Conservative Saudi Arabia

Meanwhile, hundreds U.S. soldiers are taking the fight to ISIS.

When Trump takes office, there will officially be around 500 Special Operations personnel in Syria. Their job is described as "support" and "training."

America’s Kurdish allies claim U.S. Special Forces are already on the front lines. But a few hundred U.S. boots on the ground alone won’t defeat the extremists.

The old order in the Middle East is collapsing as surely as the old borders of Iraq and Syria are disappearing. The new president needs to decide how much of America’s capital he is willing to invest in forging a new regional balance of power.

Winning the peace in Iraq and Syria depends on a political settlement involving Russia and Iran and in the new American administration helping Sunnis believe in a future, in a government, that involves them.

Otherwise the sons of ISIS will rise from the rubble of Mosul and plague this new president — and many more.

Earlier in This Series

Part 1: China Is Both Threat and Opportunity for Trump

Part 2: Kim Jong Un's Nuclear Ambitions to Challenge Trump

Part 3: Nobody Will Test Trump Administration More Than Putin

Part 4: Can Trump Stop Syria War From Haunting U.S.?