The US has agreed in principle to release high-ranking Taliban officials from Guantánamo Bay in return for the Afghan insurgents' agreement to open a political office for peace negotiations in Qatar, the Guardian has learned.

According to sources familiar with the talks in the US and in Afghanistan, the handful of Taliban figures will include Mullah Khair Khowa, a former interior minister, and Noorullah Noori, a former governor in northern Afghanistan.

More controversially, the Taliban are demanding the release of the former army commander Mullah Fazl Akhund. Washington is reported to be considering formally handing him over to the custody of another country, possibly Qatar.

The releases would be to reciprocate for Tuesday's announcement from the Taliban that they are prepared to open a political office in Qatar to conduct peace negotiations "with the international community" – the most significant political breakthrough in ten years of the Afghan conflict.

The Taliban are holding just one American soldier, Bowe Bergdahl, a 25-year-old sergeant captured in June 2009, but it is not clear whether he would be freed as part of the deal.

"To take this step, the [Obama] administration have to have sufficient confidence that the Taliban are going to reciprocate," said Vali Nasr, who was an Obama administration adviser on the Afghan peace process until last year. "It is going to be really risky. Guantánamo is a very sensitive issue politically."

Nasr, now a professor at the Fletcher School of Law and Diplomacy at Tufts University, said the Taliban announcement on the opening of an office in Qatar was a dramatic breakthrough.

"If it had not happened then the idea of reconciliation would have been completely finished. The Qatar office is akin to the Taliban forming a Sinn Féin, a political wing to conduct negotiations," Nasr said, but added: "The next phase will need concessions on both sides. This doesn't mean we are now on autopilot to peace."

Michael Semple, a former EU envoy in Afghanistan who has maintained contact with senior Taliban figures, agreed that the deal represented a critical moment.

"This is at last a real process," Semple, now at Harvard University, said. "There is a long list of things we don't have and there has been no progress on substantive issues. But now there is a certain amount of momentum. Every discussion over the past couple of years has been heavy on western enthusiasm with nothing substantial from the other side."

This time, he said, it was clear that the top Taliban council – including its reclusive leader, Mullah Omar – was on board with the proposal. In return, Semple said he thought the release of a few prisoners from Guantánamo Bay was politically feasible for the Obama administration, even in an election year.

"The prospect of ending a costly war in Afghanistan is sufficiently attractive for the Obama administration to move forward with it," Semple said.

"Even if all five of these people they release went straight back to Quetta [the Taliban stronghold in Pakistan] to rejoin a fight, it wouldn't make any real difference."

Negotiations over the opening of a Taliban political office and the release of prisoners have been underway for more than a year in secret contacts in Germany and in the Gulf between US and Taliban officials, but have been continually held up by political obstacles on all sides.

The Afghan president, Hamid Karzai, had preferred Saudi Arabia or Turkey to host the Taliban political bureau, but dropped his opposition to Qatar under heavy US pressure.

Tuesday's announcement was made by email by a Taliban spokesman, Zabiullah Mujahid.

"Right now, having a strong presence in Afghanistan, we still want to have a political office for negotiations," Mujahid said. "In this regard, we have started preliminary talks and we have reached a preliminary understanding with relevant sides, including the government of Qatar, to have a political office for negotiations with the international community."

The announcement was strongly endorsed by former officials who served under the Taliban regime in the 1990s, many of whom have been pushing for an overseas Taliban "address" for years.

"Everyone now agrees on the need for an office: the government, the foreigners and the Taliban," said Mohammed Qalamuddin, one-time head of the Taliban regime's "vice and virtue" police. "Now is the time to talk face to face with the Taliban and ask them what they want and why they are fighting."

He said that a number of leading Taliban took part in the secret talks that led to agreement with Qatar, including the former Taliban ambassador to Saudi Arabia, Shahabuddin Dilawar, the former deputy foreign minister Sher Mohammad Stanekzai and Tayeb Agha, a top aide to Mullah Omar, the mysterious Taliban leader who, even in power, only ever met with a handful of western diplomats.

"The important thing is that all these men are operating with the approval of Mullah Omar," he said.

It is not clear when the office will open, and there is also likely to be disagreement on the role of the Kabul government. A senior Afghan government official said the Karzai administration had accepted the creation of a Taliban office in Qatar only after demanding assurances from foreign powers that any peace process must be kept under the firm control of the Afghan government.

"If it is not led and owned by the Afghan government, it will fail," the official said.

However, Tuesday's Taliban statement said the group was only interested in talking to the "United States of America and their foreign allies," Mujahid said.

Western diplomats hope the opening of an office in Qatar will also lessen Pakistan's control of the Taliban. Pakistan plays host to most of the Taliban leadership, which it sees as an important bargaining counter in negotiations over the future of the region.