President Trump has suspended about a quarter billion dollars in military aid to Pakistan. That move is the right one, but an examination of the wider failed U.S. policy toward the Afghanistan-Pakistan region is warranted and how that unending fiasco has evolved.

In late 2001, in response to the sheltering by the Afghan Taliban, then the rulers of Afghanistan, of al-Qaeda and its leader Osama bin Laden, the perpetrators of the horrific 9/11 attacks, the U.S. overthrew the Taliban government using U.S. military, the CIA and local anti-Taliban fighters. So far, so good.

However, the George W. Bush administration began to make mistakes. To fulfill a political goal of touting a new way of fighting—minimal U.S. ground forces combined with local forces and U.S. air power—the administration didn’t insert enough U.S. ground forces into Afghanistan to catch and capture or kill bin Laden. He paid off local Afghan forces and escaped into Pakistan, a longtime friendly area for Islamist militants.

Because Bush then became preoccupied with diverting scarce U.S. intelligence and Special Operations assets to launch a disastrous invasion of Iraq, bin Laden was able to use his sanctuary in Pakistan to hide from the United States for an additional 10 years—when Barack Obama, Bush’s successor, launched a successful raid to kill him 2011.

However, Bush made an even bigger error. To reduce the chances that Afghanistan would harbor terrorists in the future, Bush decided to launch a nation-building war to bring democracy to Afghanistan. A non-Muslim foreign occupation of Afghanistan unsurprisingly led to a resurgence of the Islamist Afghan Taliban, using Pakistan as a sanctuary and gaining popular support in the Pashtun tribal areas of Afghanistan to throw out the foreign infidels.

Pakistan has been an ostensible U.S. ally since the Cold War, when the United States unintentionally helped spawn al-Qaeda in the first place by supporting, through Pakistan, radical Islamist Mujahadeen rebels fighting the Soviet non-Muslim occupation of Afghanistan during the 1980s. The United States should have learned from the Soviet defeat in Afghanistan—and the British failure three times during the late 1800s and early 1900s to win in that country—that non-Muslim occupiers inflame a potent Islamist pushback.

However, the cry in the U.S. foreign policy circles seemed to be the arrogant, “But those non-Muslim foreigners weren’t the United States.”

Predictably, against the United States, the Afghan Taliban, like their historical antecedents, were able to “protract the war” (as George Washington said about his winning strategy against the much more powerful British forces in the American Revolution). And the Afghan Taliban and their allies took advantage of the sanctuary in Pakistan and the passive, even active support of the Pakistani government, which was playing a “double game” that supported Afghan Taliban forces killing U.S. troops while at the same time raking in billions in U.S. aid.

In 2009, after more than seven years of U.S. failure to subdue Afghanistan, instead of withdrawing U.S. forces from Afghanistan, cutting U.S. losses and terminating all aid to Pakistan’s two-faced government, President Obama—throwing a bone to the U.S. military to give them a better chance finally to pull victory out of the fire—foolishly doubled down and escalated the war as his new administration began.

Fast forward through an additional eight years of abject failure to 2017 and see a replay of 2009, as another new president, Donald Trump—who loves to pose as a tough guy and therefore likes advisers with stars on their lapels—begins to go down the escalation path yet again.

But what has been the outcome of this 16-year quagmire in Afghanistan? The nation-building war that Bush, Obama and now Trump continue to wage has destabilized neighboring Pakistan further.

A Pakistani Taliban arose from the Islamist militant stew in western Pakistan, created by the U.S. military presence in Afghanistan, and has been challenging the Pakistani government—therefore requiring U.S. military aid to the Pakistani government to combat it. The United States therefore unintentionally helped create the Pakistani Taliban, some of whose members are now operating under the ISIS banner back in Afghanistan and against the Afghan government and U.S. forces. ISIS in Afghanistan is now more ruthless than even the radical Taliban ever was.

After 9/11, instead of getting ensnared in a long-term entanglement on the ground in the Afghan “graveyard of empires,” to remake that country, and instead of getting diverted to an unrelated bog in Iraq, the United States should have used its undivided intelligence, Special Forces, covert action and air combat assets to try to neutralize bin Laden and al-Qaeda much earlier. That mission was eventually accomplished and has been done for some time now.

President Trump is right to cut off aid to Pakistan, but he should also reassess the entire Af-Pak regional picture. It’s time to remember the shining U.S. victory over bin Laden and al-Qaeda in that part of the world, admit defeat in remodeling Afghanistan, and withdraw all American forces before the continuing U.S. military presence inadvertently creates a super ISIS there.