A suicide bomber blew himself up at a defence ministry gate in Kabul on Saturday killing nine civilians during a visit to Afghanistan by US defence secretary Chuck Hagel, underlining the insurgent threat as Nato troops prepare to leave.
Hagel was nowhere near the explosion, said a spokesman for Afghanistan's Nato-led International Security Assistance Force (ISAF). A US defence official said Hagel was in a safe location at an ISAF facility.
An Afghan Defence Ministry official said at least nine people, all civilians, were killed. Fourteen people were wounded in the attack, carried out by an insurgent on a bicycle.
Roads around the ministry building, which is near the presidential palace, were closed as emergency officials cleared the area of debris and washed blood from the street. A wall surrounding the ministry was pockmarked with shrapnel.
The Afghan Taliban claimed responsibility for the attack and said the ministry was the target. They said in a statement the attack "is a kind of message" for Hagel.
The blast underscored the security challenges facing Afghanistan as US-led Nato forces prepare to leave the country by the end of 2014.
Hagel, who arrived in Afghanistan on Friday for his first trip abroad as defense secretary, was moved from a briefing room at a Nato base to a more secure location after the blast, a US official said.
The explosion was audible during a briefing for reporters travelling with Hagel.
After the blast, the defense secretary flew to Bagram Air Base near Kabul for closed-door meetings with commanders.
Hagel is due to hold talks with President Hamid Karzai, whose recent orders to curtail US military activity highlights an often tense relationship with the 66,000 American forces here.
The decorated Vietnam war veteran is seeking to make his own assessment of America's longest war as it enters its final stretch.
Hagel is making his first trip to Afghanistan since a mid-2008 visit with then-senator Barack Obama during Obama's campaign for the presidency.
Obama, a Democrat, forged a close bond with Hagel, a Republican, and remarked later that summer that the two agreed on almost "every item" of foreign policy.
Hagel was confirmed as defense secretary on Feb 26 and was sworn into office the next day.
His advice may help shape some of Obama's most lasting decisions on Afghanistan, notably how large a residual mission to keep there once Nato wraps up its combat mission at the end of next year and the vast majority of foreign forces go home.
On Tuesday, the outgoing head of the US military's Central Command, General James Mattis, disclosed that he recommended keeping 13,600 American troops in Afghanistan - above the range of troop levels US officials have said were being considered by the White House and discussed by Nato defence chiefs last month.
Obama last month announced the withdrawal of 34,000 American troops - about half the total - by early next year. Officials also have outlined the expected pace of the withdrawal through next April.