Mr. Obama condemned what he called a “dark and painful chapter in our history” and said that the interrogation techniques would never be used again. But he also repeated his opposition to a lengthy inquiry into the program, saying that “nothing will be gained by spending our time and energy laying blame for the past.”

Mr. Obama said that C.I.A. officers who were acting on the Justice Department’s legal advice would not be prosecuted, but he left open the possibility that anyone who acted without legal authorization could still face criminal penalties. He did not address whether lawyers who authorized the use of the interrogation techniques should face some kind of penalty.

The four legal opinions, released in a Freedom of Information Act lawsuit filed by the A.C.L.U., were written in 2002 and 2005 by the Justice Department’s Office of Legal Counsel, the highest authority in interpreting the law in the executive branch.

The first of the memos, from August 2002, was signed by Jay S. Bybee, who oversaw the Office of Legal Counsel, and gave the C.I.A. its first detailed legal approval for waterboarding and other harsh treatment. Three others, signed by Steven G. Bradbury, sought to reassure the agency in May 2005 that its methods were still legal, even when multiple methods were used in combination, and despite the prohibition in international law against “cruel, inhuman or degrading” treatment.

All legal opinions on interrogation were revoked by Mr. Obama on his second day in office, when he also outlawed harsh interrogations and ordered the C.I.A.’s secret prisons closed.

In the memos, the Justice Department authors emphasized precautions the C.I.A. proposed to take, including monitoring by medical personnel, and the urgency of getting information to stop terrorist attacks. They recounted the C.I.A.’s assertions of the effectiveness of the techniques but noted that interrogators could not always tell a prisoner who was withholding information from one who had no more information to offer.

The memos include what in effect are lengthy excerpts from the agency’s interrogation manual, laying out with precision how each method was to be used. Waterboarding, for example, involved strapping a prisoner to a gurney inclined at an angle of “10 to 15 degrees” and pouring water over a cloth covering his nose and mouth “from a height of approximately 6 to 18 inches” for no more than 40 seconds at a time.