Two high-ranking officials from the European Union and the United Nations - one British, the other Irish - have been ordered to leave Afghanistan.
The EU and UN have been eradicating poppy crops in Helmand
The two men, based in Helmand province, southern Afghanistan, had been holding meetings with different tribes and groups, including possibly the Taleban.
The Afghan government has given them 48 hours to leave and the UN has said that it will comply with the request.
But officials hope to resolve what they have called a misunderstanding.
"We are currently trying to clarify the situation with the Afghan authorities, and we are hopeful that our staff member and the UN can continue with the essential work that is required to deliver peace, stability and progress to the people of Helmand province," said UN spokesman Aleem Siddique.
Homayun Hamidzada, spokesman for Afghan President Hamid Karzai, said: "The foreign nationals have been declared persona non grata and their Afghan colleagues have been arrested and are being investigated."
He said they had been "involved in some activities that were not their jobs".
Alastair Leithead, BBC correspondent in Kabul, says the two, one of whom was acting head of the EU mission in Afghanistan, spoke to a lot of different groups across the country.
He says their role was to try to find out what was happening "on the ground" with tribal elders, government representatives and non-government representatives.
Officials have stressed these discussions should not be interpreted as support for the Taleban.
Our correspondent says people are describing the situation as a storm in a teacup which has been taken much further than expected.
Intense diplomacy is continuing to try and resolve the situation, he adds.
Helmand province, where the two men were based, is the heart of Afghanistan's drug-producing region, and the EU and UN have been playing a major role in the eradication programme.
Analysts say the poppy industry has been a primary reason for the Taleban's resurgence in the south of the country.