An explosion rocked Kabul on Saturday, hours after the newly appointed U.S. Defense Secretary Chuck Hagel landed in the Afghan capital.
At least nine people were killed and 14 others injured, police said.
A suicide bomber apparently targeted the Afghan ministry of defense, said Charlie Stadtlander, ISAF spokesman.
Hagel was not injured, and is in a safe International Security Assistance Force location, according to the U.S. military.
He was in a briefing at the time and "continued as planned without interruption," Pentagon spokesman George Little said.
The bomber wearing a suicide vest approached the ministry on a bicycle, also laden with explosives, Kabul police said. He detonated near its gate.
A Taliban spokesman claimed responsibility for the attack and expressed pleasure with Hagel's proximity at the time.
The ISAF commander, Gen Joseph Dunford, disputed that the attack signified any alert by the Taliban to its reach.
"I'm not sure that I would accept that the Taliban knew the secretary was here in time to have planned that particular operation," he said. "We've been extremely successful in preventing threats to Kabul. There has been violence, there are still people out there who want to conduct violence in Kabul, but I don't think this sends a message that the Taliban can do what they want to do when they want to do it. In fact, I'm confident they can't do that."
Hagel referred to the blast in comments to reporters and expressed condolences to the victims.
"I wasn't sure what it was," he said. "I was in a briefing... but we're in a war zone. I've been in war. So, shouldn't be surprised if a bomb goes off or an explosion."
Journalists assembled at a separate location, Camp Eggers, heard the blast, which also shook the facility. No one was hurt.
Minutes before the large explosion, they could hear other booming sounds.
Attendees were initially moved to a safer location, but have since been released and are expected to continue with their scheduled plans.
A loud speaker announcement at Camp Eggers informed the attendees: "We are not directly under attack at this facility."
The camp temporarily went into lockdown mode.
Camp Eggers and ISAF headquarters are within walking distance from the Afghan defense ministry.
Small arms fire continued there after the blast, ISAF said.
Hagel is the first Vietnam veteran to head the defense department. He is in Afghanistan to thank the troops, he said, and "to better understand where we are in Afghanistan."
Hagel met with rank-and-file troops -- the first time he had done so since assuming his post -- and awarded Purple Hearts to two soldiers, Pfc. Harry Hikes of Marysville, Washington, and Sgt. Jeremyah Williams of Sacramento, California.
The defense secretary also presented coins to about 100 soldiers. He asked one soldier where he was from, to which the reply was Pine Bluff, Arkansas.
"Pine Bluff? I think I've got a bar bill there!" Hagel said.
During the trip, the defense department also reiterated U.S. support for South Korea in the event of military aggression from the North. Little also said that North Korea cannot unilaterally terminate the Armistice Agreement, according to legal language included in it.
This is Hagel's first trip in nearly five years to the country that has been a theater of war for the United States longer than any other in history.
On his last visit in summer 2008, he traveled with then-Senator Barack Obama.