The Afghan government has ordered the UK to hand over detainees held in military jails in Helmand and Kandahar.
An Afghan investigation found 23 prisoners in two UK facilities; one had been held for 31 months.
In contrast, on the day the investigator went to look, he found no detainees being held at US facilities in the two bases.
The move comes after the High Court in London ruled that holding detainees for more than 96 hours was unlawful.
The issue of Afghan civilians detained by foreign forces has become a personal one for President Hamid Karzai.
The last British troops will leave Helmand in a matter of months and, although the election to replace him is under way, the president has continued to be outspoken in his criticism of what he sees as abuses by foreign forces.
His investigation was led by a state prosecutor, Abdul Shakur Dadras.
Mr Dadras said: "In Afghan law foreigners are not allow to arrest anyone.
"Non-Afghan military forces do not have the right to hold any prisoners even for a day or an hour."
He said that of the 17 prisoners he saw in Camp Bastion none had been held for less than a month.
And he said he was told by the British authorities in the camp that the prisoner held for 31 months, Noor Ahmad, was a dangerous man and should not be released.
But Mr Dadras said national and international laws "do not allow them to hold someone for that long".
"Whether he is a dangerous man or not it is the right of Afghan forces to investigate," he said.
'Dog bit me'
I spoke to Abdul Qayum and his son Amanullah, farmers from Babaji in western Helmand, two of the hundreds of people in the province caught up in the net cast by British soldiers in recent years.
Babaji has been the scene of fierce fighting with the loss of many British lives in 2008.
In 2013 the two men were awoken by loud noises and lights in the middle of the night and told to come out of their house.
Amanullah said: "It was so dark that you could not see your hand in front of your face, and there was heavy rain.
"I wanted to call to my father, but the translator told me not to move, or the foreigners would shoot.
"I said I would not move.
"Then they told me to come forward with my hands up, and they arrested me and set the dog on me.
"The dog bit me here. Look you can still see the mark."
After he was bitten by the dog, Amanullah says soldiers swore at him, insulting him and his wife.
The two were questioned because improvised explosive devices were found in the road near their house.
They were held for six days, two days longer than the legal maximum of 96 hours, and released without charge.
By then Abdul Qayum's arm had been so badly damaged by the way he was tied up that a year later he has not recovered full use of it.
They were caught between the British - who would arrest them if they did not act as informers - and the Taliban, who would kill them if they did.
On a recent visit to Helmand, UK Defence Secretary Philip Hammond told me the policy was right.
British troops detain suspected extremists captured on the battlefield under the authority of the UN security mandate that governs all their military actions in Afghanistan.
"We are engaged in combat here; we are allowed to use all necessary measures under the UN security council resolution," he said.
The policy is to transfer detainees to Afghan authorities as soon as possible if they are not released.
Mr Hammond would not comment on individual cases, such as the man held for 31 months, but he said the court cases had been inconsistent.
Britain was previously prevented by a court order from handing over suspects because of concerns about the quality of Afghan justice, but is now condemned for not handing them over.
"We have been slightly caught between a rock and a hard place, with one court in London telling us we shouldn't be holding detainees, we should give them to the Afghans, and other courts having previously told us we should only hand over detainees to the Afghans under very strict circumstances," he said.
Mr Hammond said he had confidence in the Afghan detention facility at Parwan, north of Kabul, built with international money to process suspects captured by troops.
He said that there was good oversight of the jail.
"We are very sure that people are being treated properly and are receiving the justice they deserve," he added.
But it is only three months since the US expressed open anger at a decision to release 65 detainees from Parwan, mostly captured by US forces, who they believed had not been properly investigated.
Again the move came on the direct order of President Karzai, but the US State Department said it violated agreements made between the two countries.
This issue has continued to poison already bad relations between President Karzai and the main troop-contributing nations, and the president has shown that he will use every opportunity to raise the issue.