BAGRAM AIR FIELD, Afghanistan (AP) -- America's top military officer said today the U.S. threat to withdraw all troops out of Afghanistan if no security pact is signed might encourage the enemy and lead some Afghan forces to align with the Taliban.

Army Gen. Martin Dempsey, chairman of the Joint Chiefs of Staff, said Tuesday's announcement of President Barack Obama's order to begin planning for a total withdrawal also makes Afghan military leaders anxious and eats away at their troops' confidence.

Speaking at the end of a long day of meetings with his commanders in Afghanistan, Dempsey said he wanted to make sure they knew there still is a lot of work to do this year, and they can't let worries about next year distract them.

Obama, frustrated with his Afghan counterpart, President Hamid Karzai, ordered the Pentagon to accelerate planning for a full U.S. troop withdrawal from Afghanistan by the end of this year. But Obama also is holding out hope Afghanistan's next president eventually might sign a stalled security agreement that could prevent the U.S. from having to take that step.