The Taliban has agreed to open an office in Qatar, seen as a precursor to peace talks in Afghanistan.

In a statement, Zabiullah Mujahid, a spokesman for the Taliban, said that along with agreeing to set up the office in Qatar, the group was asking that Taliban detainees held at the American prison in Guantánamo Bay, Cuba, be released. Mr. Mujahid did not say when the Qatar office would be opened, or give specifics about the prisoners the Taliban wanted freed.

American officials have said in recent months that the opening of a Taliban mission would be the single biggest step forward for peace efforts that have been plagued by false starts. The most embarrassing came in November 2010, when it emerged that an impostor had fooled Western officials into thinking he represented the Taliban and then had disappeared with hundreds of thousands of dollars used to woo him.

If all goes as planned, the opening of an office in Qatar will give Afghan and Western peace negotiators an “address” where they can openly contact legitimate Taliban intermediaries.

Now the ball goes into America’s court. As mentioned above, the Taliban seeks the release of their prisoners from Guantanamo as part of a goodwill gesture preparatory to peace talks. Congress is apparently going ballistic, and because of laws in the NDAA and other bills, the process for getting clearance to release Guantanamo detainees is almost impossibly complex. Yet the promise of peace and a legitimate exit in Afghanistan is surely something the White House finds attractive.

There were indications that Hamid Karzai opposed the Taliban office in Qatar, but those have subsided. Pakistan also wants a role in any final negotiations, and may reject direct talks in Qatar without their input. At any rate, a negotiated solution will likely take years, until at least the 2014 date when US troops are supposed to hand over security operations to the Afghans. Even with US troop deaths down in Afghanistan in 2011, this draws out a war of questionable strategic value.

But short-term success probably depends on the next move with the Taliban prisoners at Guantanamo. No decision has yet been made on the transfer of those prisoners to Afghan custody. It could determine whether legitimate peace talks will be initiated.