If you like the unfolding disaster in Obama-abandoned Iraq, you are going to love Obama-abandoned Afghanistan.

Just two weeks before Iraq descended into chaos, President Obama stepped into the Rose Garden to announce his plan to withdraw all U.S. forces from Afghanistan by the end of 2016. “It’s time to turn the page on more than a decade in which so much of our foreign policy was focused on the wars in Afghanistan and Iraq,” Obama declared. “Americans have learned that it’s harder to end wars than begin them — but this is how wars end in the 21st century.”

If Iraq is how wars end in the 21st century, we’re in big trouble.

In Iraq, we are seeing what happens when the United States withdraws and leaves a security vacuum in its wake. When Obama took office, al-Qaeda in Iraq (now the Islamic State of Iraq and Syria, or ISIS) was defeated militarily and ideologically. The terrorists had been driven from their safe havens, and the Sunni masses had risen up to join the United States in driving them out. Then Obama’s complete withdrawal of U.S. forces in 2011 took the boot off of the terrorists’ necks — giving them space to regroup, reconstitute, retake cities and now threaten the Iraqi capital.

Afghanistan will be no different if Obama goes through with his withdrawal plans. The Taliban is nowhere near as defeated today as ISIS was when Obama withdrew U.S. forces from Iraq. Just last week, the Taliban launched a major attack on NATO in eastern Afghanistan. Not only is the Taliban not militarily defeated, but it is winning the ideological struggle as well. Obama’s release of five senior Taliban leaders from Guantanamo Bay, Cuba, was a shot in the arm for the Taliban — celebrated as a “great victory” by their leader, Mullah Omar. The eventual return of the Taliban Five to Afghanistan will energize and embolden Taliban forces.

If Obama withdraws, the Taliban will retake cities and territory it lost during Obama’s 2009 surge. At a bare minimum, it will restore control over large swaths of the country, and in a worst-case scenario it could take back Kabul and control the entire country. In either case, al-Qaeda will return to Afghanistan, reclaiming the safe haven it lost after the terrorist attacks of Sept. 11, 2001. Moreover, with U.S. forces completely withdrawn, al-Qaeda will have greater freedom of movement across the border in Pakistan, because the United States cannot carry out drone strikes in Pakistan without bases in Afghanistan.

Meanwhile, unless Obama acts, ISIS will consolidate its control over large swaths of Iraq and Syria — and could even take control of Baghdad. This will leave us with a situation far worse than the status quo before Sept. 11. Before Sept. 11, our enemies controlled one nation. Now they will control two — one Islamic caliphate in Iraq controlled by ISIS, and another in Afghanistan controlled by the Taliban and core al-Qaeda.

These two caliphates will then compete for followers among the jihadi faithful by using their new safe havens to see which one can carry out the most successful attacks against the United States and her allies. The leader of ISIS, Abu Bakr al-Baghdadi, issued a warning to Americans in January, declaring, “Soon we’ll be in direct confrontation. So watch out for us, for we are with you, watching.”

These are the wages of U.S. retreat. Obama clearly wants to go down in history as the president who ended George W. Bush’s wars. But he is learning that when it comes to ending wars, the enemy gets a vote — and the United States’ enemies are not ready to end their war against us.

Speaking in the Rose Garden last month, Obama declared: “We have to recognize that Afghanistan will not be a perfect place, and it is not America’s responsibility to make it one.” But our goal has never been to make Afghanistan a “perfect place.” It is to ensure that Afghanistan does not once again become a terrorist safe haven from which our enemies can plan another attack like the one we suffered on Sept. 11, 2001.

That is the United States’ responsibility.

If Obama stays on his current track, Afghanistan will soon join Iraq in the descent into chaos and terrorist control. Then, instead of going down in history not as the president who ended wars, Obama will go down in history as the president who lost them — and created the conditions that led to the next attack.

Read more from Marc Thiessen’s archive, follow him on Twitter or subscribe to his updates on Facebook.