A visiting United Nations envoy said that torture remains "endemic and routine" in Sri Lanka's counterterrorism methods and a number of persons being detained without trial under a harsh anti-terror law is a stain on the country's international reputation.

Ben Emmerson, U.N. special rapporteur on human rights and counterterrorism, said at the end of a five-day visit to Sri Lanka Friday that he is concerned that even those arrested as recently as late last year had been subjected to torture despite a new government promising to end such practices.

The abuses continued even after Sri Lanka's bloody civil war ended in 2009 when government troops crushed ethnic Tamil rebels' 26-year campaign for an independent state. Both sides were accused of serious human rights violations in the conflict.

"In Sri Lanka, however, such practices are very deeply ingrained in the security sector and all of the evidence points to the conclusion that the use of torture has been, and remains today, endemic and routine, for those arrested and detained on national security grounds," Emmerson, a British lawyer, said.

The number of deaths in the conflict is not clear, and a conservative U.N estimate suggests 100,000 had died. A subsequent U.N. report said at least 40,000 Tamil civilians were killed in the final months of the fighting.

Emmerson said that he heard "distressing stories" during his interviews with former and current detainees under the Prevention of Terrorism Act. They included asphyxiation using plastic bags drenched in kerosene, the pulling out of fingernails, the insertion of needles beneath the fingernails, the use of various forms of water torture, the suspension of individuals for several hours by their thumbs and the mutilation of genitals.

He said he obtained official figures that said 70 persons detained under the terrorism act had been in detention for more than five years without trial, with 12 for more than 10 years.

"These staggering figures are a stain on Sri Lanka's international reputation. Steps should be taken to release these individuals on bail immediately, or bring them to trial within weeks or months, not years or decades," he said.

Sri Lanka was facing international sanctions for refusing to investigate allegations of human rights violations and war crimes. But the country's outlook changed after the election of a new president, Maithripala Sirisena, whose government co-sponsored a U.N resolution in 2015 promising to address the past and ensure accountability and reconciliation.

According to a March report by the International Truth and Justice Project — an evidence-gathering organization administered by a South Africa-based nonprofit foundation — 47 of the abuse victims who later fled abroad described being tortured at a Sri Lanka security forces' headquarters. They said the military's chief aim was to learn of any ongoing rebel activity as well as the location of hidden weapons caches, according to the report.

Emmerson said that the fulfillment of the Sri Lankan government's commitments to the U.N human rights council has virtually ground to a halt.