The United States and Afghanistan have signed a deal to transfer all prisoners in the military-run prisons at Bagram Air Force Base to the control of the Afghans, a move that paves the way for a long-term security arrangement.

The Strategic Partnership Agreement, which Washington and Kabul have been discussing for over a year, will be the framework for U.S. involvement in Afghanistan beyond 2014, when the last foreign combat troops are due to leave Afghanistan.

Afghan Defense Minister Gen. Abdul Rahim Wardak, who signed the deal to hand over the prison at Bagram airbase, said an Afghan commander would soon be appointed to take charge of the facility. The transfer would be completed in about six months.

“The signing of this memorandum is an important step forward in our Strategic Partnership negotiations,” said General John Allen, commander of the United States forces in Afghanistan, at the ceremony.

The deal comes in the wake of violence in Afghanistan after the unintentional burning of Korans which were taken from prisoners at Bagram. This is seen as a first step to transferring all US-run prisons to the Afghans.

This isn’t the only precondition that Afghanistan has sought for a long-term security agreement. They also want NATO to stop the night raids on Afghan homes. That will end up being the major sticking point here. The US wants a long-term basing agreement that would keep some troops in the country beyond 2014. The Afghans want an end to the terrorizing of people in their homes. Something has to give.

Along with continuing night raids, the prison transfer was one of the red lines, incidentally, that Lindsey Graham laid down. A transfer of prisoners, Graham said, would cause him to “throw in the towel” on US involvement in Afghanistan. Well, now he can throw it in, and that would add another member to the growing Out of Afghanistan caucus.

A case in point: 24 Senators just organized a letter to the President calling for the removal of troops. The letter is made up of mostly the usual suspects, including Republicans Mike Lee and Rand Paul. But the really interesting part is that Max Baucus organized the letter. He’s not exactly an antiwar firebrand. Here’s an excerpt.

It is time to bring our troops home from Afghanistan. The United States intervened in Afghanistan to destroy al Qaeda’s safe haven, remove the Taliban government that sheltered al Qaeda, and pursue those who planned the September 11th attacks on the United States. Thanks to the exceptional service and sacrifice made by the American Armed Forces and our allies, those objectives have largely been met. We should continue to confront America’s enemies wherever they are through targeted counterterrorism operations and end the large scale counterinsurgency effort in Afghanistan.

We simply cannot afford more years of elevated troop levels in Afghanistan. We are spending roughly $10 billion in Afghanistan each month at a time when we’re making tough sacrifices at home. Your recent budget calls for $88 billion more for the war in Afghanistan in 2013. If this money is appropriated, we will have spent a total of $650 billion in Afghanistan. A majority of Americans worry that the costs of the war in Afghanistan will make it more difficult for the government to address the problems facing the United States at home. They’re right.

There’s actually now a federal statute, part of the NDAA of last year, “requiring a plan to accelerate the drawdown of troops from Afghanistan.” Defense Secretary Panetta has said that the drawdown of combat troops could wrap up by the end of next year. It’s time to get going on this.