WASHINGTON American soldiers in Iraq are packing up military gear and shutting down bases as the United States races to remove all but a couple hundred troops by year's end.
In Afghanistan, U.S. generals are scrambling to stretch a shrinking force to match enemy insurgents who remain dangerous and defiant after more than 10 years of war.
Plans to withdraw U.S. troops from Iraq by December 31 and to steadily reduce the force in Afghanistan over the next three years reflect President Barack Obama's determination to end the costly, bloody wars that defined the decade after the September 11, 2001, attacks on the United States.
But do they also reflect battlefield conditions? For those who might suspect that military decisions are being made without sufficient attention to lingering risks on the ground and long-term security, the withdrawals are troubling.
"In some ways this has been done backward. We are looking at the resources we have and the political climate we face, and from that deriving the end state we want in Iraq and Afghanistan," said Joshua Foust, a security analyst at the American Security Project, a nonpartisan think tank.
When Obama, who opposed the Iraq war from the outset, announced last month that he was abandoning efforts to secure a modest troop presence in Iraq after 2011, he repeated his view that the "tide of war" was receding.
He promised that the U.S. force that stood at 180,000 troops in Iraq and Afghanistan when he took office in 2009 would be halved by 2012. "Make no mistake: it will continue to go down," he said.
Obama has promised responsible, conditions-based withdrawals. But his political opponents are quick to link his blueprint for ending the unpopular wars to his hopes for winning re-election in November 2012.
Obama also wants to cut spending -- the Iraq war alone has cost U.S. taxpayers more than $700 billion in purely military expenditures -- and focus on the struggling U.S. economy.
Obama's top military advisors voiced doubts in June when he announced his plan for withdrawing from Afghanistan the extra 33,000 troops he deployed there after a 2009 strategy review by the end of September 2012. They said they had initially sought a slower, less risky drawdown, but later backed Obama's plan.
The White House has asked the Pentagon for initial recommendations for the U.S. troop presence in Afghanistan in 2014, a first step in planning the final U.S. drawdown there despite a bleak security outlook.
Despite intense deliberations about the pace of withdrawal, most foreign combat troops are expected to be gone by the time Afghan forces are due to take over responsibility for the country's security at the end of 2014.
While U.S. and NATO soldiers have driven Taliban insurgents out of some southern strongholds, bloodshed continues to be fueled by militants' safe havens in Pakistan. The United Nations says overall violence is at its worst since the war began in 2001.
Last week, a suicide car bomber killed 17 people in Kabul, including 13 troops and civilian employees of the NATO-led forces, the latest bold attack in the Afghan capital that deepened questions about NATO claims of progress.
"I have grave concerns," one Republican congressional committee aide said on condition of anonymity. "It seems that the withdrawal is a bigger priority than actually achieving our objectives."
Anthony Cordesman, a U.S. security expert at the Center for Strategic and International Studies think tank, said the Obama administration was continuing to debate what U.S. goals should be in Afghanistan after the U.S. raid that killed al Qaeda leader Osama bin Laden in Pakistan in May.
Achievements like the killing of the al Qaeda leader, many officials believe, have reduced the threat of an attack by the network on U.S. soil and gone a long way toward accomplishing a finite U.S. mission in the region. It's not the responsibility of the United States -- or within its power -- to turn Afghanistan into a model, modern democracy, they say.
"We're in Afghanistan because of 2001, not because this is a vital American interest," Cordesman said. "We got rid of Osama bin Laden, but we can't solve the Pakistan problem, we can't solve the Taliban problem, we can't solve the governance problem."
While U.S. commanders dream of having a larger force to battle the Taliban and militant allies like the Haqqani network, they voice cautious confidence that they can achieve their narrowly defined goals in Afghanistan.
"We've been given an order ... and our assessment is that yes we can do it," a U.S. military official said on condition of anonymity. "Will there be spikes in violence? Yes. Will there be casualties and setbacks? Yes. Will we prevail and push through those things? I think so."
"I don't necessarily think we're hell-bent for leather to pull troops out regardless of what's happening," the official said.
Come January 1, after 8-1/2 years of fighting in Iraq and almost 4,500 U.S. soldiers killed, and in line with a deal negotiated under former President George W. Bush, the major U.S. military presence in that country will come to an end.
Less than 200 U.S. soldiers are expected to remain in Iraq, part of a State Department task force responsible for military sales and, to some extent, advising Iraq's security forces.
Violence in Iraq has dropped dramatically. But the country remains unstable, haunted by the ghosts of a civil war that killed tens of thousands of civilians, and unable to settle major sectarian and ethnic conflicts impeding political progress and economic growth.
The withdrawal has worried U.S. conservatives who fear the United States is handing Iran influence over Iraq, a country that was supposed to anchor U.S. interests in the Middle East.
"It's a fulfillment of a campaign promise by the president of the United States in 2008 to get out of Iraq. That's all it is," Senator John McCain, a top Republican, said this week.
Others say Iran's influence in Iraq is overstated.
Osama al-Nujaifi, speaker of Iraq's parliament, said the full U.S. drawdown is in Iraq's interest, regardless of what it means for the United States. "Now there is no way but to depend on ourselves," he said.
Security experts like Jeff Dressler of the Institute for the Study of War think tank warn against thinking that al Qaeda has been disabled permanently in Iraq or Afghanistan and say the group may seek to recruit new supporters by proclaiming that it forced the United States out of both countries.
"There is nothing al Qaeda would like more than capitalizing on the anarchy of a post-U.S. Iraq and Afghanistan," Dressler said.
(Additional reporting by Waleed Ibrahim and Ahmed Rasheed in Baghdad, Hamid Shalizi and Dan Magnowski in Kabul, and Susan Cornwell in Washington; Editing by Warren Strobel and Will Dunham)