U.S. Defense Secretary Chuck Hagel got a stark taste of the challenges that continue to bedevil Afghanistan on Saturday, as insurgents carried out two deadly bombings, one within earshot of the Pentagon chief.

The Afghan government, meanwhile, abruptly canceled a ceremony scheduled for Saturday that had been meant to show that Kabul and Washington had finally reached a deal for the handover of a U.S. military prison. At the last minute, Afghan President Hamid Karzai balked at the proposed terms of the handover of the Parwan Detention Facility, Afghan and U.S. officials said, dashing hopes that a resolution of a contentious issue that has poisoned the relationship between the two countries was in sight.

“There is frustration when it comes to the issue of Afghan sovereignty in the prison transfer, and when we see that what we asked for is not respected,” said Aimal Faizi, Karzai’s spokesman. “Whenever it happens again, our position will be the same.”

Afghan officials say they will not extend veto power to the United States when it comes to the release of detainees, even a small group of high-profile prisoners of particular concern to U.S. officials. That issue has long appeared to be intractable, given U.S. concern that dangerous insurgents would promptly return to the battlefield upon being released.

On Saturday night, Karzai issued a statement saying the prison handover would occur in the coming week, but it was not clear whether it reflected an aspiration or an actual resolution.

Hagel’s first full day in Kabul as defense chief started ominously, as a suicide bomber riding a bicycle detonated explosives outside the main gate of the Defense Ministry, a rare security breach in one of the capital’s most heavily policed areas. Nine people were killed and 10 were wounded, Mohammed Daud Amin, the deputy police commander of Kabul, said. The majority of the victims were civilians.

Less than an hour later, a man detonated a vest loaded with explosives near the capital of the eastern Khost province, killing eight children and one police officer, said Mobarez Zadran, a provincial spokesman. Afghan officials said the man was targeting a joint U.S.-Afghan military patrol when he was stopped by the police officer, which led him to trigger the explosive device. The slain children were playing in the area at the time, officials said.

“We’re at war,” Hagel said later, speaking to reporters at a military base in Jalalabad, also in the east, where he traveled to meet with U.S. troops. “War didn’t stop. That’s just the reality.”

A Taliban spokesman said the group had carried out Saturday’s attack in Kabul in an effort to prevent Hagel from “spreading lies” about the insurgency’s weakness.

Violence was not the only disappointment of the day.

U.S. and Afghan officials have been at odds for more than a year over the fate of detainees in American custody in Afghanistan. Karzai wants the Americans to cease detention operations entirely, but U.S. officials have insisted on a phased handover of their detention system, arguing that an abrupt handover would be dangerous.

Karzai balked on Friday to a few of the terms Afghan and American negotiators had reached in the latest round of talks, prompting the Afghan government to hastily scrap the ceremony at the Parwan facility, which would have presented an image of synergy between Washington and Kabul during Hagel’s visit.

“The Parwan deal has been a long time in the making,” a senior defense official said, speaking on the condition of anonymity to discuss the dispute. “There have been a few hiccups at the end.”

The official said the terms Karzai has not agreed to are “not terribly substantial,” adding that these disputes have become part and parcel of the U.S.-Afghan relationship. “This happens frequently, especially with the Afghans,” the official said.

Aside from the issue of veto power, Karzai raised concerns about the importance of sharing U.S. intelligence about Afghan detainees. Although some of that intelligence could be declassified and given to Afghans, much of it will remain restricted in accordance with American national security policy.

If U.S. officials want to interrogate a detainee more than 96 hours after his capture, Faizi said, Karzai has stipulated that those officials must submit a formal request to an Afghan review board before gaining access to the prison.

“When the final draft was presented to the president, he decided several changes needed to be made at the last minute,” Faizi said. “He worried that the language used raised questions about sovereignty.”

Beyond the detention issue, Karzai has sought to curb U.S. military authority by calling for the expulsion of special forces from a key eastern province that serves as a gateway to the capital. Karzai called for U.S. elite troops to leave Wardak province by Sunday after accusing them two weeks ago of committing abuses. But a coalition official told reporters Saturday that that deadline is not firm and officials are holding out hope that the Afghan government will reconsider that position.

“There’s a little bit of space in terms of the exact date,” said the official, who briefed reporters on the condition of anonymity. The official said that a probe into the Wardak allegations has “found no evidence of misconduct by our forces.”

Hagel said he was hopeful a resolution would be reached, but he offered no details.