Fresh claims have emerged that MI5 was aware of allegations that Afghan detainees were being mistreated by the country's security service during the period UK forces were handing prisoners over to the Afghan authorities.

Last week the high court heard details of torture allegedly suffered by prisoners handed over to the Afghan domestic security service. A memo, seen by the Observer, reveals that the head of Afghanistan's intelligence agency indicated to UK officials in March 2007 that he was aware of ill-treatment claims involving prisoners.

In the document, marked confidential, Amrullah Saleh, chief of the National Directorate of Security (NDS), admits he is "aware of allegations of mistreatment" relating to detainees in Kandahar province.

Human rights lawyers allege that no action appears to have been taken by UK forces as a result and that British troops handed over detainees to the NDS Kandahar facility in 2007.

The memo coincides with a judicial review in the high court, being brought by anti-war activist Maya Evans against Britain's policy of transferring suspected insurgents.

The court heard how six Afghan detainees – Taliban suspects – handed over by British troops to NDS prisons were allegedly deprived of sleep, whipped with rubber cables and subjected to electric shocks. Backed by law firm Public Interest Lawyers, Evans argues Britain has breached the Human Rights Act by handing over prisoners to a country known to participate in torture. The lawyers claim the NDS had a notorious reputation for mistreating prisoners and British officers should have known of the risks.

Saleh's admission is contained in a memo written a month before allegations surfaced in the Canadian press that the country's soldiers deliberately transferred prisoners to be tortured. The allegations provoked uproar in Canada with pressure still building on the government to launch a public inquiry into the claims.

The judicial review heard the government concede that British forces had maintained access into the NDS facility for UK interrogators, suggesting a close intelligence relationship with the Afghans. The judges also heard claims that government denials of such detainee abuse involving British forces were the result of a "head in the sand" attitude.

Lawyers for the Ministry of Defence deny that detainees routinely handed over by British soldiers suffer torture and insist safeguards against their mistreatment were in place.

In late 2008, military and Foreign Office officials were denied access to Afghan detention centres while UK forces were told not to transfer any more captured Afghans to the NDS.

Jonathan Evans, director-general of MI5, recently strenously denied complicity in torture, adding "nor do we collude in torture or encourage others to torture on our behalf".

Evans said: "Only now has the government clearly admitted that it cannot hand over prisoners where there is a risk of torture by the NDS. The evidence is overwhelming. This practice must stop."

British Forces in Afghanistan handed over Taleban suspects to Afghan authorities who tortured them, it was alleged in the High Court yesterday.

The Ministry of Defence denies the claims by human rights groups and insists that British authorities maintained tight controls and monitoring to ensure the wellbeing of prisoners.

Public Interest Lawyers, which has previously worked on allegations of prisoner abuse in Iraq, presented dossiers of testimony in London that it claims is part of a “dreadful and continuing story” of abuse.

The allegations cover claims from nine of 410 prisoners that they were tortured after being transferred to the Afghan National Directorate of Security (NDS). Their testimony includes claims of beating, electric shocks, sexual abuse, stress positions and sleep deprivation.

Similar allegations have been levelled against the Canadian Government. A Canadian parliamentary inquiry into the claims is continuing after a diplomat, Richard Colvin, said that prisoners entrusted to the custody of the Afghan authorities were invariably tortured. He told the parliamentary commission in Ottawa that he warned officials in Afghanistan about the abuses. “The NDS tortures people,” he said. “That’s what they do. So if we don’t want detainees tortured we shouldn’t give them to the NDS.”

Amnesty International first made claims that Western forces were handing over prisoners to abuse in 2007. Britain rejected the claims and said that there was a detailed system of checks and balances.

In the case brought by Public Interest Lawyers on behalf of Maya Evans, a human rights activist, it is alleged that British authorities failed to maintain the regime of checks properly. The group is seeking a judicial review on the Government’s prisoner transfer policy in Afghanistan.

Nine prisoners allege that they were tortured at the main NDS facility in Kandahar, others at a facility called NDS Department 17. Their allegations cover a period between June 2006 and November 2007.

Prisoner D alleges that he was beaten and tortured with electric shocks. Another prisoner alleges that he was raped by a senior NDS officer. Others allege beatings with metal rods and rubber hoses. Prisoner G states that he “confessed” after six consecutive nights of beatings.

Michael Forham, QC, argued before the court that transfers to the NDS violated Article 3 of the European Convention on Human Rights, which protects against inhuman and degrading treatment.

The Ministry of Defence said: “Whenever we have received allegations of mistreatment, we ensure that the Afghan authorities, the International Red Cross and the independent Afghan Human Rights Commission are informed as long as individuals have given their consent for us to do so. Although, the UK does not have jurisdiction to investigate allegations made against Afghan security forces, we will offer advice where we can and we press the Afghan authorities to share their findings.”