at least seven people, including a young girl, were killed when a car bomb exploded outside a compound housing Westerners in Kabul hours after US President Barack Obama made a short visit to the city.

The attack killed a Gurkha guard and six passers-by and wounded another 17 people.

The Taliban said it was in response to Mr Obama's visit and to a strategic partnership deal he signed with Afghanistan's President Hamid Karzai. The pact sets out a long-term US role after most foreign combat troops leave by the end of 2014.

Mr Obama's visit came a year after US special forces troops killed al Qaeda leader Osama bin Laden, the architect of the September 11 attacks, in a raid in neighbouring Pakistan.

The President, in a televised address to the American people from a base north of Kabul, said the war in Afghanistan was winding down.

He said: "As we emerge from a decade of conflict abroad and economic crisis at home, it's time to renew America.

"This time of war began in Afghanistan, and this is where it will end."

Nearly 3000 US and Nato soldiers have been killed in the country since the Taliban rulers were ousted in 2001.

Mr Obama also spoke to US troops during his six hours in Afghanistan and emphasised bin Laden's demise, an event his re-election campaign has touted as one of his most important achievements.

He said: "Not only were we able to drive al Qaeda out of Afghanistan, but slowly and systematically we have been able to decimate the ranks of al Qaeda, and a year ago we were able to finally bring Osama bin Laden to justice."

He made his strongest claim yet that the defeat of al Qaeda was "within reach", but warned of further hardship ahead.

Mr Obama added: "I recognise many Americans are tired of war. But we must finish the job we started in Afghanistan and end this war responsibly."