The European Court of Human Rights issued a historic ruling Thursday condemning the CIA's renditions programs in the case of a German man who said he was mistaken for a terrorism suspect and then held, interrogated and tortured for four months at an Afghan prison run by the CIA.

The ruling was a long-awaited victory for Khaled El-Masri, who had failed for years to get courts in the United States and Europe to recognize him as a victim.

The court agreed that El-Masri was a victim of torture and abuse.

El-Masri says he was kidnapped from Macedonia in 2003 and held at an Afghan prison known as the Sand Pit.

He says that once U.S. authorities realized he was not a threat, they illegally sent him to Albania and left him on a mountainside.

"Beyond reasonable doubt' 

Macedonian authorities argued that El-Masri had been detained on suspicion of travelling with false documents, then travelled on his own to neighboring Kosovo — an argument the  European court called "utterly untenable."

The court, based in Strasbourg, France, ruled that El-Masri's account was "established beyond reasonable doubt" and that Macedonia "had been responsible for his torture and ill-treatment both in the country itself and after his transfer to the U.S. authorities in the context of an extra-judicial rendition."  

It said the government of Macedonia violated El-Masri's rights repeatedly and ordered it to pay €60,000 in damages.

Macedonia's Justice Ministry said it would enforce the court ruling and pay El-Masri the damages.  

United States officials have long since closed internal investigations into the El-Masri case, and Obama administration has distanced itself from some counterterrorism activities conducted under former U.S. president George W. Bush.   

But several other legal cases are pending from Britain to Hong Kong involving people who say they were illegally detained in the CIA program. Its critics hope the El-Masri ruling will lead to court victories for other rendition victims.  

The CIA declined to comment on Thursday's ruling.

El-Masri's lawyer, Manfred Gnjidic, said he hoped the ruling would inspire El-Masri to resume contact with his lawyers and family, which he broke off after he was sentenced to two years in prison in 2010 for assaulting the mayor of the German town of Neu-Ulm.  

"I hope this will give him a little bit more confidence again that even a little person who has come into a crime of great nations has the chance to have his rights," he said.  

The court's rulings are binding on the 47 member-states of the Council of Europe, the continent's human rights watchdog.