Afghan policemen and security personnel watch as smoke rises from a guesthouse at the site of an attack in Kabul on May 2, 2012.
The statement was released hours after the militants launched an attack on an area east of the capital Kabul where many Westerners live.
The attack which was followed by hours of fighting between militants and security forces left at least seven people dead.
Taliban claimed responsibility for the attack and vowed more strikes.
“Afghans don’t like invaders and they have to leave this country,” said Taliban spokesman Zabiullah Mujahid.
The attack occurred only hours after Obama ended a short visit to Afghanistan where he signed an agreement with Afghan President Hamid Karzai to extend the US presence in the country to another decade beyond 2014.
After signing the deal, Obama went to the US-run Bagram Air Base in eastern Afghanistan, met with US troops, and gave a televised speech before ending his surprise visit.
He said Washington was building enduring cooperation with Kabul to train Afghan forces to help them take full responsibility for security.
It was Obama’s fourth visit to Afghanistan, his third as the commander-in-chief.
Violence has also spread from Afghanistan’s volatile south to the relatively peaceful areas over the course of the past year.
The US-led invasion of Afghanistan was launched in 2001. The offensives removed the Taliban from power, but insecurity continues to rise across the country, despite the presence there of about 130,000 foreign troops.