Al-Qaeda is still "heavily embedded" within the Taliban in Afghanistan, in spite of a historic US-Taliban agreement earlier this year, a senior United Nations official has told the BBC.
Earlier this year, the US signed an agreement with the Taliban committing to withdrawing all American forces from the country by next summer if the Taliban ensured groups including al-Qaeda were not able to use Afghan territory to plot international attacks.
But Edmund Fitton-Brown, co-ordinator of the UN's Islamic State, Al-Qaeda and Taliban Monitoring Team, has told the BBC that the Taliban promised al-Qaeda in the run-up to the US agreement that the two groups would remain allies.
"The Taliban were talking regularly and at a high level with al-Qaeda and reassuring them that they would honour their historic ties," Mr Fitton-Brown said.
He said the relationship between al-Qaeda and the Taliban was "not substantively" changed by the deal struck with the US. "Al-Qaeda are heavily embedded with the Taliban and they do a good deal of military action and training action with the Taliban, and that has not changed," he said.
Eliminating the threat from al-Qaeda and overthrowing the Taliban regime that had harboured them was the original basis for the US invasion of Afghanistan, following the 9/11 attacks. At the time, President George W Bush vowed to hunt the militants until there was "no place to run, or hide, or rest".
Al-Qaeda's strength and ability to strike the West has significantly diminished over the past decade, but its leader Ayman al-Zawahiri is believed to still be based in Afghanistan along with a number of other senior figures in the group. The Afghan intelligence services announced on Saturday they had killed Husam Abd al-Rauf, a high ranking Egyptian al-Qaeda member, in an operation in Ghazni province. Mr Fitton-Brown told the BBC that despite its lower profile, al-Qaeda remained "resilient" and "dangerous".
Taliban officials have insisted that they will fully adhere to the conditions of their agreement with the US: preventing any group from using Afghan soil as a base to plan attacks against the US and its allies. The insurgents say they aim only to implement an "Islamic government" within Afghanistan, and will not pose a threat to any other country.
The Taliban has also highlighted its fight against Islamic State group militants as an example of its commitment against other extremists. But the Taliban regard IS as rivals, whereas they have had a close relationship with al-Qaeda since that groups' inception.
Mr Fitton-Brown said he had noted recent reports about the Taliban requiring some Pakistani foreign fighters in Afghanistan to register with them and abide by a code of conduct forbidding attacks outside Afghanistan. Mr Fitton-Brown said it was not yet clear whether that agreement applied to al-Qaeda, nor whether it was an "irrevocable" move toward preventing foreign militants posing a threat internationally from Afghanistan.
American officials have been vague when questioned as to whether or not they believe the Taliban is fully complying with its commitments on al-Qaeda, often suggesting that the information is classified. Ambassador Nathan Sales, co-ordinator for counterterrorism at the US state department, told the BBC: "We expect the Taliban to honour the commitments that they made… to end all connections with terrorist organisations in Afghanistan. We intend to continue monitoring the situation very closely to ensure actions are matching words."
But with the Afghan conflict mired in a deadly and costly stalemate, President Trump has made clear his desire to bring US troops home as soon as possible. The number has already been reduced to about 4,500, with a further reduction to 2,500 expected by January 2021.
One diplomat closely observing the process told the BBC the US withdrawal plans were no longer "condition based" but "agenda based", suggesting President Trump's overriding priority is to end America's longest-ever war. At times President Trump has appeared out of step with military advisers, recently criticising defence officials who, he said, "want to do nothing but fight wars".
Speaking to the BBC, Rahmatullah Andar, a former Taliban commander and now spokesman for the Afghan government's National Security Council, warned of the threat of a resurgence from al-Qaeda and other global militant groups. "The Americans might think the agreement they have signed with the Taliban will sort everything out," he said. "But time will prove that's not the case."
Taliban officials too have often been vague when asked about their relationship with al-Qaeda, at times claiming the group no longer has any presence in Afghanistan. Last year, al-Qaeda in the Indian Subcontinent, the regional branch of the group, released a video of an ambush it carried out against Afghan government forces in support of the Taliban.
Al-Qaeda members swear allegiance to the Emir, or leader, of the Taliban. When asked last year how the Taliban could crack down on a group that pledges loyalty to its leader, a Taliban official in Doha claimed that the latest oath by the leader of al-Qaeda had never been formally "accepted". Another former Taliban figure told the BBC that the pledge of allegiance could be considered "invalid" if al-Qaeda disobeyed Taliban orders to refrain from plotting attacks abroad.
How the Taliban's relationship with al-Qaeda develops could determine the future of the Afghan peace process. The Taliban's commitments on international terrorism are the most tangible demands that need to be met as part of the US-Taliban withdrawal agreement. However, the issue is likely to prove divisive, with Taliban hardliners thought to oppose any measures cutting their links with al-Qaeda.
It is feared the Afghan peace process is in any case losing its momentum. Despite the beginning of long delayed negotiations between the Taliban and an Afghan government-led delegation last month in Qatar, violence has continued and even intensified in recent weeks.
The negotiations have stalled amid attempts to resolve preliminary issues, with major issues such as a ceasefire or power-sharing arrangement yet to be discussed. There are fears that if US troops are withdrawn next year, before an agreement has been reached, the violence could intensify and the Taliban push for a military victory.
Mr Fitton-Brown warned that, were the peace process to fall apart, al-Qaeda and the Islamic State group could attempt to further exploit "ungoverned space" in Afghanistan.
"Both of those groups have an avowed aspiration to pose an international threat," he said.