* U.S. defense secretary safe, nowhere near explosion
* At least nine civilians killed, 14 people wounded
* Taliban claim responsibility
* Hagel to meet Karzai, residual mission on agenda
A suicide bomber blew himself up at a Defence Ministry gate in Kabul on Saturday killing nine civilians during a visit to Afghanistan by U.S. Defense 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 U.S. 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 U.S.-led NATO forces prepare to leave the country by the end of 2014.
Some Afghans fear that another civil war could erupt or the Taliban will make a push to take control of the country again after Western combat troops withdraw.
In the eastern province of Khost, a suicide bomber attacked a joint Afghan and foreign patrol in a village, killing seven civilians and one policeman, the provincial governor's office said in a statement.
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 U.S. 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 U.S. 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 U.S. military's Central Command, General James Mattis, disclosed that he recommended keeping 13,600 American troops in Afghanistan - above the range of troop levels U.S. officials have said were being considered by the White House and discussed by NATO defence chiefs last month. [ID: nL1N0BXGWZ]
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.