Afghan Army soldiers stop people from getting close to the Afghan Defense Ministry after a suicide bomber on a bicycle struck outside the building, killing at least nine Afghan civilians. Half an hour later, 10 people including eight children were killed in another suicide blast in Khost.

KABUL, Afghanistan — Militants staged two suicide attacks that killed at least 19 people on Saturday, the first full day of U.S. Defense Secretary Chuck Hagel’s visit to Afghanistan.

They were a fresh reminder of the challenges posed by insurgents to the U.S.-led NATO force as it hands over the country’s security to the Afghans.

“This attack was a message to him,” Taliban spokesman Zabiullah Mujahid said of Hagel, in an email to reporters about one of the bombings, outside the country’s Defense Ministry in Kabul. He did not comment on the other attack.

Hagel was nowhere near the Kabul blast, but heard it across the city. He told reporters traveling with him that he wasn’t sure what it was when he heard the explosion.

“We’re in a war zone. I’ve been in war, so shouldn’t be surprised when a bomb goes off or there’s an explosion,” said Hagel, a Vietnam War veteran.

Asked what his message to the Taliban would be, he said that the U.S. was going to continue to work with its allies to insure that the Afghan people have the ability to develop their own country and democracy.

In the first attack, a suicide bomber on a bicycle struck outside the Afghan Defense Ministry early Saturday morning, just as employees were arriving for work.

About a half hour later, another suicide bomber hit a joint NATO and Afghan patrol near a police checkpoint in Khost city, the capital of Khost province in eastern Afghanistan, said provincial spokesman Baryalai Wakman.

Nine Afghan civilians were killed in the bombing at the ministry and 14 wounded, and two Afghan policemen and eight children died in the blast in Khost while another two Afghan civilians were wounded, according to a statement from President Hamid Karzai’s office.

Karzai condemned the bombings, calling them un-Islamic. “The perpetrators of such attacks are cowards who are killing innocent children at the orders of foreigners,” he said in a statement emailed to reporters. Karzai usually uses the term “foreigners” to refer to Pakistan, which he blames for failing to crack down on Taliban militants who take sanctuary there.

Hagel’s first visit to Kabul as Pentagon chief comes as the U.S. and Afghanistan grapple with a number of disputes, from the aborted handover of a main detention facility — canceled at the last moment late Friday as a deal for the transfer broke down — to Afghan President Hamid Karzai’s demand that U.S. special operations forces withdraw from Wardak province just outside Kabul over allegations of abuse.

Karzai released a statement late Saturday saying the transfer of the prison to Afghan control would go ahead in the coming week. It was unclear what derailed Saturday’s ceremony. U.S. officials declined to comment on the statement, which was released after he met with top military commander in Afghanistan Gen. Joseph Dunford this evening in Kabul

The prison transfer, originally slated for 2009, has been repeatedly delayed because of disputes between the U.S. and Afghan governments about whether all detainees should have the right to a trial and who will have the ultimate authority over the release of prisoners the U.S. considers a threat.

The Afghan government has maintained that it needs full control over which prisoners are released as a matter of national sovereignty. The issue has threatened to undermine ongoing negotiations for a bilateral security agreement that would govern the presence of U.S. forces in Afghanistan after the current combat mission ends in 2014.

Regarding Wardak, Karzai set a deadline for Monday for the pullout of the U.S. commandos, over allegations that joint U.S. and Afghan patrols engaged in a pattern of torture, kidnappings and summary executions.

“Each of those accusations has been answered and we’re not involved,” said Brigadier Adam Findlay, NATO’s deputy chief of staff of operations, in an interview with The Associated Press Saturday. “There are obviously atrocities occurring there, but it’s not linked to us, and the kind of atrocities we are seeing, fingers cut off, other mutilations to bodies, is just not the way we work.”

Findlay said NATO officials have made provisional plans to withdraw special operations forces, if Karzai sticks to his edict after meetings this weekend with Hagel and top military commander in Afghanistan Gen. Joseph Dunford.

“What we’ve got to try to do is go to a middle ground that meets the president’s frustration,” but also keeps insurgents from using Wardak as a staging ground to launch attacks on the capital, Findlay said. “That plan would be that you would put in your more conventional forces into Wardak,” to replace the special operators and maintain security, he said.

NATO officials see the weekend violence as part of the Taliban’s coming campaign for the spring fighting season. “There’s a series of attacks that have started as the snow is thawing. We had a potential insider attack yesterday ... and there’s been a number of attacks on the border,” Findlay explained.

The suspected insider attack occurred in Kapisa province in eastern Afghanistan several hours before Hagel arrived Friday. Three men presumed to be Afghan soldiers forced their way onto a U.S. base and opened fire, killing one U.S. civilian contractor and wounding four U.S. soldiers, according to a senior U.S. military official.

The official said investigators were “95 percent certain it was an insider attack,” because the three men came from the Afghan side of the joint U.S.-Afghan base, and rammed an Afghan army Humvee through a checkpoint dividing the base, before jumping out and opening fire on the Americans with automatic weapons. All three attackers were killed.

The official spoke on condition of anonymity because he was not authorized to speak publicly.

The Taliban said it was not behind the Tagab base attack, and has not yet weighed in on the attack in Khost, but the group claimed responsibility for the morning attack at the ministry shortly after it happened.