Europe's top human-rights court ruled Thursday that Poland allowed the CIA to detain two terrorism suspects at a secret prison on its territory where they were exposed to "torture and inhuman or degrading treatment."

In a 400-page ruling, the European Court of Human Rights said Poland violated the European Convention on Human Rights and failed to properly investigate what had happened to Abd al-Rahim al-Nashiri, a Saudi national, and Abu Zubaydah, a Palestinian born in Saudi Arabia, while they were in CIA custody.

The CIA brought a number of suspected al-Qaeda members to the prison, including Zubaydah, Nashiri, and Khalid Sheikh Mohammed, the self-admitted mastermind of the Sept. 11, 2001, attacks. While imprisoned on a military base in northern Poland, a pair of CIA contractors waterboarded Mohammed 183 times. A CIA operative also subjected Nashiri to a mock execution and put a drill to the head of the blindfolded man, according to several former CIA officials and a report by the agency's inspector general.

"For all practical purposes, Poland had facilitated the whole process, had created the conditions for it to happen, and had made no attempt to prevent it from occurring," the court said in the first judicial ruling on the rendition and interrogation program created by the administration of President George W. Bush after the 9/11 attacks.

The decision is a victory for human-rights advocates who petitioned the court in Strasbourg, France, to hold Poland accountable for its role in helping the CIA establish the secret prison - code-named "Quartz" - on a Polish military base in December 2002.

The decision rested on declassified U.S. documents, media reports, and other information that described CIA activities in Poland. It comes as the CIA braces for the release of an exhaustive study of the agency's rendition, detention, and interrogation program prepared by the U.S. Senate Select Committee on Intelligence. Lawmakers have said the CIA misled them about the program's effectiveness.

The prison in Poland was closed in September 2003, with the CIA scattering the remaining detainees to sites in Morocco and Romania. In September 2006, the agency moved Zubaydah, Nashiri, Mohammed, and 13 other high-value detainees to the U.S. prison camp at Guantanamo Bay, Cuba.

Mohammed and Nashiri are separately facing military commission trials for their alleged respective roles in the Sept. 11, 2001, attacks and the 2000 attack on the USS Cole in the port of Aden, Yemen.

Zubaydah continues to be held at Guantanamo.

The court ordered Poland to pay $175,000 to Zubaydah and $135,000 to Nashiri.

The CIA and State Department declined to comment. Poland's Foreign Ministry said its legal experts had to examine the ruling, according to the Associated Press,.