During a testy video conference in June, President Obama drew a line in the sand for Afghan President Hamid Karzai. If there was no agreement by Oct. 31 on the terms for keeping a residual U.S. military presence in Afghanistan, Obama warned him, the United States would withdraw all of its troops at the end of 2014.

With that deadline less than three weeks away and deep rifts persisting, the White House appears increasingly willing to abandon plans for a long-term, costly partnership with Afghanistan. Despite the Pentagon’s pleas for patience, much of the rest of the administration is fed up with Karzai and sees Afghanistan as a fading priority amid far more ominous threats elsewhere in the world.

Secretary of State John F. Kerry arrived in Kabul Friday on an unannounced visit in an effort to convince Karzai that the administration is serious.

“October 31st is our goal,” a senior administration official said. “The president has been clear. There can be no reason” for failure “other than the fact that the Afghans don’t want what we’re offering.”