U.S. Secretary of State John Kerry and Afghan President Hamid Karzai made a show of rare, recent unity between their two nations on Monday, as the U.S. military ceded control of its last detention facility in Afghanistan, ending a longstanding irritant in relations.

Kerry arrived in the Afghan capital of Kabul on an unannounced visit amid concerns that Karzai may be jeopardizing progress in the war against extremism with anti-American rhetoric. After a private meeting, Kerry said he and Karzai were "on the same page" on security and reconciliation issues and brushed aside suggestions that relations were in peril.

‘On the same page’

Karzai had infuriated U.S. officials by accusing Washington of colluding with Taliban insurgents to keep Afghanistan weak even as the Obama administration pressed ahead with plans to hand off security responsibility to Afghan forces and end NATO’s combat mission by the end of next year.

At a joint news conference after their talks, Karzai told reporters his comments had been misinterpreted by the media. Kerry said officials sometimes make comments in public that reflect an idea that they have heard expressed by others.

si-parwan-handover-04197008

Afghan National Army soldier rolling up the red carpet after the hand over ceremony of the Parwan Detention Facility. Anja Niedringhaus/Associated Press (Anja Niedringhaus/Associated Press)

"I am confident the president (Karzai) does not believe the U.S. has any interest except to see the Taliban come to the table to make peace and that we are completely co-operative with the government of Afghanistan with respect to the protection of their efforts and their people," Kerry said. He noted that he had specifically raised the collusion comment with Karzai and was satisfied with what he had heard in response.

"We’re on the same page," Kerry said. "I don’t think there is any disagreement between us and I am very, very comfortable with the president’s explanation."

For his part, Karzai said "today was a very good day," citing the turnover of the detention facility at the U.S.-run Bagram military base north of Kabul. He also expressed gratitude for the sacrifices made for his country by Americans. However, he defended allegations he has made about American troops abusing Afghan civilians, saying they were not meant to "offend" anyone but rather to protect his people.

"When I say something publicly, it is not meant to offend our allies but to correct the situation," he said. "I am responsible for the protection of the Afghan people. I am the president of this country. It is my job to provide all the protection I can to the people of this country."

Detention facility key hurdle in dispute

Earlier Monday, the U.S. military ceded control of the Parwan detention facility near the U.S.-run Bagram military base, a year after the two sides initially agreed on the transfer. Karzai had demanded control of Parwan as a matter of national sovereignty.

si-parwan-prisoner-04196860

An Afghan prisoner waits in line for his release from Parwan Detention Facility. (Anja Niedringhaus/Associated Press)

The top U.S. commander in Afghanistan, Gen. Joseph Dunford, handed over Parwan at a ceremony there after signing an agreement with Afghan Defense Minister Bismullah Khan Mohammadi. "This ceremony highlights an increasingly confident, capable and sovereign Afghanistan," Dunford said.

The long-running dispute over the center had thrown a pall over ongoing negotiations for a bilateral security agreement to govern the presence of U.S. forces in Afghanistan after 2014.

An initial agreement to hand over Parwan was signed a year ago, but efforts to follow through on it constantly stumbled over American concerns that the Afghan government would release prisoners that it considered dangerous.

The U.S. concerns are not without foundation. Zakir Qayyum, a former Guantanamo detainee, was released into Afghan custody in 2007. Freed four months later, he rejoined the Taliban and reportedly has risen to become the No. 2 leader in the Taliban.

A key hurdle in the dispute over Parwan was a ruling by an Afghan judicial panel holding that administrative detention, the practice of holding someone without formal charges, violated the country’s laws. The U.S. argued that international law allowed administrative detentions and that it could not risk the passage of some high-value detainees to the notoriously corrupt Afghan court system.

An initial deadline for the full handover passed last September; another passed earlier this month.

The detention center houses about 3,000 prisoners and the majority are already under Afghan control. The United States had not handed over about 100, including some who do not have the right to a trial because the U.S. considers them part of an ongoing conflict.

Both Kerry and Karzai lauded the transfer of the facility. Karzai said an Afghan review board would carefully consider any intelligence provided by the U.S. or others about detainees they deem to be too dangerous to free.

The pair also called on the Taliban to take advantage of the offer to open a political office in Doha, Qatar, from where they could engage in reconciliation talks with the Afghan Peace Council and potentially negotiate an end to hostilities.

Kerry said the Taliban should not ignore the opportunity because the United States is committed to Afghanistan’s security beyond 2014 and will not allow gains made over the past decade to be lost. He noted that Obama has not yet decided how many U.S. troops should stay after next year and that the Taliban should not count on a complete American withdrawal.

There are about 100,000 coalition troops in Afghanistan, including about 66,000 from the United States. Although there is no decision on a residual force, U.S. officials have said as many as 12,000 U.S. and coalition forces could remain.