Barack Obama yesterday warned that the situation in Afghanistan was "precarious and urgent" and said the country would be the central focus of the US "war on terror" if he became president.

The presumptive Democratic candidate was speaking in Afghanistan at the start of a week-long international tour designed to bolster his foreign policy credentials.

Mr Obama is expected in Iraq today but his decision to spend the first two days of his trip in Afghanistan shows how the country has returned to the centre of the US political debate as violence climbs.

"We have to understand that the situation is precarious and urgent, and I believe this has to be the central focus, the central front, in the battle against terrorism," he told CBS News.

Coalition deaths in Afghanistan have exceeded US fatalities in Iraq for the past two months, culminating in the death of nine soldiers last week in the deadliest insurgent attack for three years.

The deteriorating situation has left Mr Obama and John McCain, his Republican rival, scrambling to refocus attention on a conflict once dubbed the "forgotten war".

Both candidates pledged last week to send two or three additional combat brigades - between 7,000 and 10,000 troops - to Afghanistan if elected.

But while there is growing consensus on the need for reinforcements, the candidates are sharply at odds over what lessons should be drawn from the resurgence by al-Qaeda and the Taliban.

For Mr Obama, it underscores his argument that the US must extricate itself from an unnecessary war in Iraq and refocus on the original battleground in the "war on terror".

For Mr McCain, it highlights the importance of having a resolute and experienced leader in the Oval Office who can turn around Afghanistan just as the "surge" strategy has reduced violence in Iraq.

David Petraeus, the top US commander in Iraq, said at the weekend the diverging levels of violence in the two war zones could signal a shift in focus by al-Qaeda back to its original home in the border region between Afghanistan and Pakistan.

He said there were signs that foreign fighters recruited by al-Qaeda to do battle in Iraq were being diverted to the largely ungoverned areas in Pakistan from which fighters can cross into Afghanistan. Attacks by militant groups against the US-led coalition in Afghanistan have risen by 40 per cent this year, compared with 2007, according to the US military.

The worsening outlook in Afghanistan is increasing pressure on the US to accelerate its troop drawdown in Iraq to free up more forces for Afghanistan. The administration agreed on Friday to set a "time horizon" for withdrawal of US troops from Iraq, marking a break from its refusal to consider timelines for ending the war.

In a radio address over the weekend, Mr McCain mocked his opponent for reiterating his plans to withdraw from Iraq even before departing for his fact-finding mission. "Apparently, he''s confident enough that he won''t find any facts that might change his opinion or alter his strategy," he said.

Mr Obama visited two US military bases and met President Hamid Karzai during his two-day stop in Afghanistan, accompanied by his Senate colleagues Jack Reed, a Democrat, and Chuck Hagel, a moderate Republican and fierce critic of the war in Iraq. Both travelling companions have been mentioned as potential running mates for Mr Obama.

Before leaving Washington, Mr Obama stressed that he was travelling to Afghanistan and Iraq as a senator before switching back to campaign mode during his planned visits to Jordan, Israel, Germany, France and the UK later this week.

"I''m more interested in listening than doing a lot of talking," he said. "And I think it is very important to recognise that I''m going over there as a US senator. We have one president at a time."

Few details of his meeting with Mr Karzai were provided. The latter''s spokesman, Humayun Hamidzada, said the pair agreed on a wide range of issues. Mr Obama has previously criticised Mr Karzai and his government for failing to "get out of the bunker" to clamp down on insurgents.

His visit came amid mounting public anger in Afghanistan about recent civilian deaths in US and coalition military operations. Four Afghan police and five civilians were killed in air strikes yesterday, described as a case of "mistaken identity". In another incident, Nato troops opened mortar fire in the southern province of Paktika, killing four civilians. The past two weeks have seen some of the worst "friendly-fire" incidents of the war against Afghan civilians, with one air strike resulting in the death of 50 people in Nangarhar.