Barack Obama today pledged to increase US troops in Afghanistan by a third if he becomes president, sending 10,000 more to reinforce the 33,000 already there.

He was speaking after the US lost nine soldiers at the weekend in the deadliest attack on its forces in the country since 2005.

Obama has promised, soon after becoming president in January, to begin scaling back the 156,000 US troops in Iraq and Kuwait, and shift the focus to Afghanistan.

He is to fill out his plans in a major foreign policy speech in Washington tomorrow ahead of his first visit to Iraq and Afghanistan since he launched his presidential bid early last year.

Details of his trip have been kept secret for security reasons but a senior Palestinian spokesman, Saeb Erekat, disclosed today that Obama will be in the region next week, with a meeting in the West Bank on July 23 with the Palestinian president, Mahmoud Abbas.

Bill Burton, a spokesman for Obama, said today's speech "will focus on the global strategic interests of the United States, which includes ending our misguided effort in Iraq". He added that a gradual, phased withdrawal of US troops "will allow the US to properly address the growing threat from a resurgent al-Qaida in Afghanistan".

Previewing the speech in an article written for the comment page of the New York Times today, Obama wrote: "As president, I would pursue a new strategy and begin by providing at least two additional combat brigades to support our effort in Afghanistan. We need more troops, more helicopters, better intelligence-gathering and more non-military assistance to accomplish our mission there."

He said that ending the war in Iraq is "essential to meeting our broader strategic goals, starting in Afghanistan and Pakistan where the Taliban is resurgent and al-Qaida has a safe haven."

In a separate comment on the campaign trail, Obama said the killings yesterday reinforced the need to switch resources from Iraq to Afghanistan.

"I continue to believe that we're under-resourced in Afghanistan," he said. "That is the real centre for terrorist activity that we have to deal with and deal with aggressively."

As well as visiting Iraq and Afghanistan, he is to go to Germany, France and Britain and call on Germany and France, in particular, to increase their involvement in Afghanistan.

His Republican rival, John McCain, is also to discuss Afghanistan this week. Randy Scheunemann, a senior McCain foreign policy adviser, noted today that Obama had voted in the Senate last year against increased resources for US troops in Afghanistan, including helicopter defences against hand-held rockets and for new body armour, as well as training Afghan forces and for building up the country's infrastructure.

"Senator Obama is not trying to have it both ways, he's trying to have it every way," Scheunemann said.

McCain's team said the fact that he was making the speech before going to Iraq suggested he would not be going with an open mind.

Although eclipsed by the US's economic slide as the main election issue, the war in Iraq remains one of the clearest points of division between Obama and McCain, who is committed to remaining in the country until stability is achieved.

Obama, in the New York Times article, reiterated his promise to have all US combat troops out by the summer of 2010, with a "residual" force left in place to fight al-Qaida and training Iraqi forces.

He did not specify how big the residual force would be - one of his advisers has speculated it could be as big as 60,000-80,000 troops _ but Obama said "we seek no presence in Iraq similar to our permanent bases in South Korea".

Obama argues that withdrawal will help the US save on the $10bn (£5bn) to $12bn it spends on Iraq each month and that money can be used elsewhere.

As well as troop increases in Afghanistan, Obama said he would use the freed resources to increase the US army overall by 65,000 and the marines by 27,000.