One of the two diplomats being threatened with expulsion from Afghanistan is from Northern Ireland.
The EU and UN have been eradicating poppy crops in Helmand
Mervyn Patterson is a high-ranking employee of the United Nations who has been working in Kabul.
The other man, Michael Semple, is from the Irish Republic and is the acting head of the EU mission in the country.
Both men, who are accused of meeting Taleban leaders, have been told to leave by Thursday. Efforts are continuing to prevent their expulsion.
Homayun Hamidzada, spokesman for Afghan President Hamid Karzai, said Afghan colleagues of the men have been arrested and are being investigated.
The BBC's Alastair Leithead in Kabul says the decision to declare the men persona non grata appears to have come from the office of the president.
Mr Karzai is due to travel to Pakistan on Wednesday, so it is likely the men will be expelled and negotiations over what the UN calls a misunderstanding may focus on allowing them to be readmitted to the country, he says.
Our correspondent says the men were in Helmand province in the south of Afghanistan, in the town of Musa Qala, recently reclaimed from the Taleban by British and Afghan troops.
The interior ministry knew they were going, but other layers of the Afghan government objected to the type of people they were meeting, he says.
The feudal and tribal nature of areas like Helmand are complicated and Taleban is a shorthand phrase for a whole variety of anti-government forces, our correspondent adds.
A spokesman for the UN in Afghanistan, Aleem Siddique, denied that the diplomats had been talking to Taleban militants.
He said they had been discussing the Afghan situation with all people on the ground to help the country's stability.
But former Afghan Interior Minister Ali Jalili told the BBC the men's actions would not have helped the peace process.
"This is going to be detrimental to the overall strategy. I think... it will be exploited by the Taleban when they see that the Afghans in the international community do not speak with one voice and also it undermines the authority of the Afghan government."
Helmand province 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.
The row comes as a British newspaper, the Daily Telegraph, reports that members of Britain's secret intelligence service, MI6, held meetings during the summer with senior Taleban members in Afghanistan.
If true, this could prove embarrassing for UK Prime Minister Gordon Brown, who just weeks ago told MPs that there would be no negotiations with members of the Taleban.