Asserting that the country that served as a base for the September 11, 2001, attacks no longer represented a terrorist threat to the United States, Mr. Obama declared that the “tide of war is receding.” And in a blunt recognition of domestic economic strains, he said, “America, it is time to focus on nation-building here at home.”

Mr. Obama announced plans to withdraw 10,000 troops from Afghanistan by the end of this year. The remaining 20,000 troops from the 2009 “surge” of forces would leave by next summer, amounting to about a third of the 100,000 troops now in the country. He said the drawdown would continue “at a steady pace” until the United States handed over security to the Afghan authorities in 2014.

The troop reductions, which were decided after a short but fierce internal debate, will be both deeper and faster than the recommendations made by Mr. Obama's military commanders, and they will come as the president faces relentless budget pressures, an increasingly restive American public and a re-election campaign next year.

Only hours after Mr. Obama spoke, President Nicolas Sarkozy of France said on Thursday that he would also begin drawing down the 4,000-strong French contingent in Afghanistan.

“Given the progress we have seen, France will begin a gradual withdrawal of reinforcement troops sent to Afghanistan, in a proportional manner and in a calendar comparable to the withdrawal of American reinforcements,” Mr. Sarkozy said in a statement issued by his office, Reuters reported.

Truthout is able to confront the forces of greed and regression only because we don't take corporate funding. Please support us in this fight: make a tax-deductible donation today.

Mr. Obama, speaking in businesslike tones during a 15-minute address from the East Room of the White House, talked of ending America's longest war and of the painful lessons he thought could be taken from it. While justifying the nation's decade-long commitment, he talked of “ending the war responsibly” and warned of the perils of overextending the military by sending large numbers of soldiers into combat. He acknowledged that huge challenges remained before an end to the conflict that has cost hundreds of billions of dollars and 1,500 American lives.

The withdrawals would begin winding down the military's counterinsurgency strategy, which Mr. Obama adopted 18 months ago. Administration officials indicated that they now planned to place more emphasis on focused clandestine counterterrorism operations of the kind that killed Osama bin Laden, which the president cited as Exhibit A in the case for a substantial American troop reduction.

“We are starting this drawdown from a position of strength,” Mr. Obama said. “Al Qaeda is under more pressure than at any time since 9/11.” He said that an intense campaign of drone strikes and other covert operations in Pakistan had crippled Al Qaeda's original network in the region, leaving its leaders either dead or pinned down in the rugged border between Pakistan and Afghanistan. Of 30 top Qaeda leaders identified by American intelligence, 20 have been killed in the last year and a half, administration officials said.

But the withdrawal of the entire surge force by the end of next summer will significantly change the way that the United States wages war in Afghanistan, analysts said, suggesting that the administration may have concluded it can no longer achieve its loftiest ambitions there.

Mr. Obama acknowledged as much in his remarks. “We will not try to make Afghanistan a perfect place,” he said. “We will not police its streets or patrol its mountains indefinitely. That is the responsibility of the Afghan government.”

Mr. Obama's decision is a victory for Vice President Joseph R. Biden Jr, who has long argued for curtailing the military operation in Afghanistan. Mr. Obama indicated a willingness to move toward more focused covert operations of the type that the United States is conducting in Pakistan, Yemen and elsewhere. “When threatened, we must respond with force,” he said. “But when that force can be targeted, we need not deploy large armies overseas.”

The pace of the withdrawal is a setback for the president's top commander in Afghanistan, Gen. David H. Petraeus, who has been named director of the Central Intelligence Agency. General Petraeus did not endorse the decision, said another official. Defense Secretary Robert M. Gates argued publicly against a too-hasty withdrawal of troops, but he said in a statement on Wednesday that he supported Mr. Obama's decision.

During the internal debate, Secretary of State Hillary Rodham Clinton also expressed reservations about the scale of the reductions, officials said.

General Petraeus had recommended limiting withdrawals to 5,000 troops this year and another 5,000 over the winter.

He and other military commanders argued that the 18 months since Mr. Obama announced the troop increase did not allow for enough time for the Americans to consolidate the fragile gains that they had made in Helmand and other provinces.

But troops have succeeded in clearing many towns and cities of insurgents, and then keeping them safe so that markets were able to reopen and girls could go to school, for example.

Military officials say the withdrawal of American troops will impose limits on which areas of the country can be pacified. In particular, plans to pivot extra American troops from south and southwestern Afghanistan to volatile areas in the east, along the Pakistan border, will be curtailed or even canceled, officials said.

The effort to transfer responsibility for security to Afghan forces remains elusive because the Afghan troops are proving unprepared for the job. Corruption in the government of President Hamid Karzai continues to be rampant, sapping the confidence of many Afghans.

Still, the growing disenchantment in the United States with the war, particularly given the ballooning national debt, the country's slow economic recovery and the whopping $120 billion price tag of the Afghan conflict this year alone, were all considerations weighed by the president. “Over the last decade, we have spent a trillion dollars on war at a time of rising debt and hard economic times,” Mr. Obama said. “Now, we must invest in America's greatest resource: our people.”

Republican presidential candidates including Mitt Romney and Jon M. Huntsman Jr are demanding a swift withdrawal from Afghanistan, while Democrats complain that the cost of the war is siphoning money away from efforts to create jobs in the United States. Representative Dana Rohrabacher, Republican of California, called on Mr. Obama to speed the withdrawal. “If we're going to leave, we should leave,” he said in a statement. “The centralized system of government foisted upon the Afghan people is not going to hold after we leave. So let's quit prolonging the agony and the inevitable.”

Highlighting the unusual political splits the war is causing, other Republicans criticized the president for pulling out too soon. Representative Mike Rogers, the Michigan Republican who is chairman of the House Intelligence Committee, suggested that Mr. Obama was playing politics with the troop reduction, saying, “The president is trying to find a political solution with a military component, when it needs to be the other way around.” He said the situation in Afghanistan was “very precarious,” and that the White House seemed to be panicking about the levels of violence.

Mr. Obama's speech, delivered at dawn on Thursday, Kabul time, is expected to be the subject of a speech by Afghanistan's president, Hamid Karzai, scheduled for later in the day. Senior figures in Mr. Karzai's administration began signaling that they were comfortable with the withdrawal of 10,000 troops by year's end.

Gen. Mohammad Zahir Azimi, a spokesman for the Defense Ministry, said the Afghan National Army “has this capability and quantity to fill the gap of those places where the foreign troops withdraw and leave Afghanistan.”

“We are ready,” General Azimi said.

Muhammad Siddique Aziz, an adviser to Mr. Karzai on tribal affairs, said the withdrawal plan was acceptable, but he warned against a complete withdrawal of American troops before the Afghan government was strong enough to administer the country on its own. “I think they have to concentrate more on the Afghan government so when they leave, the government can stand up on its own,” Mr. Aziz said.

Thom Shanker and Mark Mazzetti contributed reporting from Washington, and Alissa J. Rubin from Kabul, Afghanistan.