WASHINGTON – In a blunt warning to Afghan President Hamid Karzai, President Obama threatened on Tuesday to withdraw all U.S. troops from Afghanistan by the end of this year if a crucial security pact isn't signed — and he ordered the Pentagon to accelerate planning for just that scenario.

At the same time, in a rare phone call with Karzai, Obama said he was willing to wait his counterpart out and sign a security agreement with a new Afghan president after April elections. That would allow the United States to keep up to 10,000 troops in the country.

The effort seemed aimed at marginalizing Karzai's role in the high-stakes negotiations over the future of the lengthy American-led war.

"We will leave open the possibility of concluding a [security agreement] with Afghanistan later this year," the White House said. "However, the longer we go without a [deal], the more challenging it will be to plan and execute any U.S. mission."

Obama's attempt to minimize Karzai's importance to U.S. decisionmaking underscores how fractured the relationship between the two leaders has become. Tuesday's phone call was the first direct contact between Obama and Karzai since last June. The Afghan leader has deeply irritated Washington with anti-American rhetoric, as well as with his decision this month to release 65 prisoners over the objections of U.S. officials.

The White House insists it won't keep any American troops in Afghanistan after December without a security agreement giving the military a legal basis for staying in the country. While the White House did not publicly set a deadline for finalizing the agreement before that time, officials said the size and scope of the any U.S. mission could shrink the longer Obama waits.

Despite the troubled ties between Washington and Kabul, many of Obama's advisers want to see American troops stay in Afghanistan after the war formally concludes in December. The Pentagon envisions keeping up to 10,000 troops in Afghanistan to focus on counterterrorism and the training of Afghan security forces, though some White House advisers would prefer keeping fewer troops, if any.

The U.S. military has also drawn up blueprints for a full withdrawal, and Tuesday's developments appeared to push that idea closer to the forefront of Pentagon planning.

Obama's call to Karzai coincided with key military meetings on Afghanistan. Defense Secretary Chuck Hagel will meet with his NATO counterparts in Brussels later this week. And Joint Chiefs Chairman Gen. Martin Dempsey arrived in Afghanistan on Tuesday to assess the security situation.