The European Court of Human Rights censured Lithuania and Romania on Thursday for their complicity in the C.I.A.’s torture program, saying the two European nations had hosted secret prisons where the C.I.A. held and interrogated terrorism suspects after the Sept. 11 attacks.

The twin rulings by the court in Strasbourg, France, centered on two men — Abu Zubaydah, a stateless man of Palestinian heritage, and Abd al-Rahim Husseyn Muhammad al-Nashiri, a Saudi citizen of Yemeni descent — who since 2006 have been held at the American military prison at Guantánamo Bay, Cuba.

Using similar language, the court rejected Lithuania’s and Romania’s arguments that insufficient evidence existed to prove that the two detainees had been held on their soil or that their governments knew about the matter.

The authorities in each country, the court ruled, “knew of the nature and purposes of the C.I.A.’s activities on its territory” at the time; assisted by agreeing to host prisons and helping with rendition flights to transport detainees; and knew that “by enabling the C.I.A. to detain terrorist suspects on its territory, it was exposing them to a serious risk of treatment contrary to” the European Convention on Human Rights.