Gates was unaffected and was not in the convoy, although he did drive by the scene two hours later, a Western official speaking to AFP on the condition of anonymity said.
 
The interior ministry said that the "bomber wanted to target the foreign forces, but did not succeed. He exploded shortly before they passed".
 
Rush hour attack
 
Nazanine Moshiri, Al Jazeera's correspondent in Kabul, said: "The suicide bomber was targeting Nato forces. But as is often the case here in Afghanistan, it is the civilians that get caught up in these kinds of attacks.
 
The Taliban said that the bomber was a
university student [Reuters]
"The Nato forces weren't injured, but we understand that 22 civilians were. Most were government workers in a bus heading to work. It was rush hour.
 
"The Taliban has claimed responsibility for the attack.
 
"When we spoke to them they didn't mention that it had anything to do with Robert Gates being in the country, but we understand that they have told one agency that the suicide attack was carried out to welcome Robert Gates to Afghanistan."
 
Zabihullah Mujahed, a Taliban spokesman, said the bomber was a university student in Kabul.
 
Increasing al-Qaeda threat
 
Gates arrived late on Monday on a surprise trip to meet Hamid Karzai, the Afghan president, and Abdul Rahim Wardak, the defence minister, later on Tuesday.
 
Moshiri said of the visit: "On the agenda is the resurgence.
 
"The Americans believe that al-Qaeda is moving from Iraq into Afghanistan.
 
"They are extremely worried about the situation here, although Robert Gates did say that he believes that Afghanistan is not moving backwards. He is worried about the escalating violence."
 
This year has been the worst for violence in Afghanistan since 2001 when the Taliban was removed from power.
 
The Taliban has carried out the majority of the 140 suicide attacks in the country in 2007.
 
The violence has led to almost 6,000 deaths - mostly to forces opposing the Nato alliance but including more than 200 foreign troops and about 1,000 Afghan security forces.
 
Last month a European think-tank said that opposition fighters had a permanent presence in more than half of the country.
 
However, Brigadier-General Carlos Branco, an Isaf spokesman, said on Tuesday that the Taliban control no more than five of the 59 districts of southern Afghanistan.