The National Crime Agency has admitted that it unlawfully shared intelligence with Thai police investigating the murder of University of Leeds student David Miller and another British backpacker.
Two Burmese men, Zaw Lin and Wai Phyo, were found guilty of killing Mr Miller and Hannah Witheridg in 2015 and sentenced to death.
Lawyers for the two men launched a High Court challenge in London, and this has led to an admission by the NCA that in five instances the assistance it provided to the Thai police, relating to phone data and intelligence, was "not in accordance" with official government guidance and for that reason unlawful.
Ms Witheridge, 23, from Hemsby in Norfolk, and Mr Miller, 24, from Jersey, were murdered on the island of Koh Tao in September 2014.
Human rights campaigners Reprieve condemned the NCA for "secretly handing over" evidence that helped secure death sentences in a country known for unfair trials and torture.
Lin and Phyo, who face execution by lethal injection, both claim they were tortured.
Reprieve says their trial was "marred by widespread allegations of corruption".
An NCA spokesman said the agency had acted in good faith and conducted a review to ensure official guidance was complied with in the future.
The application by Lin and Phyo for judicial review against the NCA at London's High Court was settled earlier this month when the agency conceded in a court order that it had wrongly provided phone data to the police in Thailand on September 19 2014.
The NCA also admitted in a schedule to the August 21 order that it had, without proper ministerial consent, provided intelligence about "a person who had displayed anti-British female sentiment" at a local beach bar, and about "person(s) with whom the murdered individuals had had an argument".
In October 2014 it also wrongly provided information about Mr Miller "being involved in a dispute with certain persons on the island of Koh Phangan", and the need for DNA samples to be taken "from a potential suspect".
The NCA said it misinterpreted the 2014 Overseas Security and Justice Assistance Guidance, and failed to consult with government departmental ministers in a case where ministerial authorisation would be required for any assistance which "might directly or significantly contribute to the use of the death penalty".
Maya Foa, director of Reprieve, said: "It is bad enough that the National Crime Agency secretly handed over evidence to help secure death sentences in a country known for unfair trials and torture.
"But they now admit they did this illegally, without any proper thought that their actions could contribute to a grave miscarriage of justice with two men now facing execution.
"UK cooperation with foreign police and security forces should be open and transparent. Government agencies shouldn't have to be dragged through the courts for the public to know what is being done with their money."
Reprieve also said the evidence and intelligence had been used selectively against Lin and Phyo and potentially pointed to other suspects.
An NCA spokesman said: "The NCA's assistance to the Thai authorities was provided in good faith in the context of a fast-moving investigation into the murders of two British citizens, in the shared interest of apprehending those responsible.
"However, we accept that the sharing of some intelligence with the Royal Thai Police in the immediate aftermath of the murders to assist their investigation was not in accordance with HM Government's Overseas Security and Justice Assistance (OSJA) guidance.
"In light of this the NCA has carried out a full review of our internal processes regarding OSJA guidance, to inform future decisions and ensure compliance."