At yesterday’s joint press conference with British Prime Minister David Cameron, President Barack Obama ruled out any deadline for ending NATO’s air assault in Libya. “Qadhafi and his regime need to understand that there will not be a let-up in the pressure that we are applying,” Obama said. “Ultimately,” he added, “this is going to be a slow, steady process in which we’re able to wear down the regime forces.”

It is troubling that he has refused to express similar resolve in the U.S. and NATO mission to stabilize Afghanistan, where much more is at stake for U.S. national security interests.

The Libyan intervention was undertaken with a humanitarian goal: to protect Libyan civilians. It is a noble cause, but one in which the United States has no vital national interest. The war in Afghanistan, however, is a crucial effort to defeat terrorists and stabilize a region that has served as a major launching pad for terrorist attacks against Americans.

Yet instead of signaling to the Taliban and its al-Qaeda allies that the U.S. remains committed to ensuring Afghanistan never again becomes a safe haven for international terrorists, Obama repeatedly talks about withdrawing U.S. troops according to an arbitrary deadline. Indeed, 18 months ago in a speech at West Point, Obama promised to begin withdrawing U.S. troops—and that was long before the additional 30,000 “surge” troops had even been deployed to Afghanistan.

Broadcasting to the enemy that you will make battlefield decisions based on arbitrary timelines rather than conditions on the ground is a recipe for failure. While President Obama appears to understand this simple logic when it comes to Libya, he has failed to grasp it where it counts most—in Afghanistan. There, al-Qaeda could easily regroup if U.S. forces were to exit prematurely.

If the President were to withdraw U.S. troops from Afghanistan this summer beyond what may be justified by conditions on the ground, he would squander the gain made by eliminating Osama bin Laden. Instead, the U.S. should build on bin Laden’s death by seeking to convince Taliban leaders to break ties to al-Qaeda and join a legitimate peace process in Afghanistan.

The U.S. is at a crucial juncture in Afghanistan. Continued talk of large-scale troop withdrawals would tip the balance in the wrong direction, strengthening those in the Taliban who advocate continuing the fight.

While a transition to Afghan-led security is beginning, rushing U.S. troops out of the region would risk sacrificing the gains made in the past six months. A recent report by the Defense Department noted that U.S. and coalition forces have made “tangible progress” by arresting the momentum of the insurgency in much of Afghanistan and disrupting insurgent leadership networks.

Arbitrary U.S. withdrawal from Afghanistan would open the door for the Taliban to regain influence in the region and allow al-Qaeda and its affiliate organizations to regroup and revitalize. The U.S. instead needs to press its advantage in Afghanistan and demonstrate its commitment to helping ensure long-term stability in the region.

If President Obama can boldly commit to continue fighting for limited humanitarian goals in Libya, he should rethink his apparently half-hearted commitment to winning in Afghanistan. The outcome there will determine whether the U.S. ultimately defeats the threat of Islamist terrorism.

Co-authored by James Phillips.