Barack Obama is to set an ambitious timetable for the withdrawal of US forces from Afghanistan, with the first troops pulling out by July 2011. The announcement is aimed at countering US public fears that the country is being sucked into a Vietnam-style morass.

Reflecting the increased sense of urgency, Obama is to speed deployment of an extra 30,000 American troops to Afghanistan within the next six months – a much faster timetable than the 12 to 18 months that had been briefed by US officials up until today.

The 30,000 figure is lower than requested by the US commander in Afghanistan, General Stanley McChrystal, but the Obama administration is hoping that other Nato countries will make up the difference. A senior administration official said the Nato secretary general, Anders Fogh Rasmussen, will announce the deployment of extra troops on Friday.

The additional US forces are intended to counter Taliban expansion and help the Afghan army and police take over responsibility for security faster.

The White House press secretary, Robert Gibbs, spoke today of "an accelerated timetable". During a round of television interviews he said the faster the US forces move in, the faster they will move out. "We can't be there forever," he said.

Obama was looking for an "end game" and wanted to "get in there quickly" and transfer responsibility for security to the Afghan military as rapidly as possible, Gibbs said. An administration official said the US aimed to begin winding down troop numbers in July 2011.

Gibbs indicated that there would be no further escalations beyond the one Obama approved on Sunday. Asked on Good Morning America if this would be the last order for extra troops, he said: "The president sure believes so."

US officials said Obama wants almost all the US troops out before the end of his first term in office in January 2013, leaving behind a small contingency force. Gibbs said the president did not want to leave the problem to his successor.

The new strategy comes at the end of three months of intensive debate in Washington over the future of Afghanistan, an issue that has swamped the rest of Obama's agenda. The president, in the biggest decision of his term so far, had to choose between options ranging from sending only a few thousand more troops to the 40,000 requested by McChrystal. The president was set to expand on the thinking behind the new strategy in a speech last night at the US military academy at West Point, New York state.

The risk for Obama is that the extra 30,000 troops may not be enough to counter an increasingly confident Taliban and that the timetable for training the Afghan army and police is over-optimistic.

Two brigades, one from the US marines and one from the army, plus reserves, amounting to 30,000, are to be sent to Afghanistan over the next six months, bringing American troops in the country to 100,000. They are to be based in the south and east, where US and British forces are under pressure and badly in need of reinforcements. The first of the marines are due to arrive before Christmas.

Britain has already committed to sending more troops. Extra troops for Afghanistan will be on the agenda at a Nato meeting scheduled for next week.

There are 95,000 Afghan troops at present and the US wants that number up to 134,000 by October 2010, three years earlier than originally envisaged, and then to 240,000 by 2013. There are about 92,000 Afghan police and the US target is 160,000 by 2013.

There is scepticism about whether the Afghan army and police can be trained up that quickly to take over. At present, the Afghan army has a loss rate of about 25% of its members trained by US and its Nato allies, the bulk of whom just walk away.

Obama, who has already set a timetable for withdrawal of a sizeable chunk of US forces from Iraq by 2011, is keen to shed the label of "war president" and increase his chances of re-election to a second term. Public opinion in the US is steadily turning against the Afghanistan war in the face of mounting American casualties and lack of faith in Hamid Karzai's government.

Obama spoke to Karzai for an hour late on Monday night to brief him about the new strategy that will include "benchmarks" for the Afghan government not only to train more members of the Afghan army and police but also to take steps to tackle government corruption.

Obama's speech is to be followed by appearances at Congress by the secretary of state, Hillary Clinton, the defence secretary, Robert Gates, and the chairman of the joint chiefs of staff, Admiral Michael Mullen.