WASHINGTON - President Barack Obama left the door open on Tuesday to prosecuting some U.S. officials who laid the legal groundwork for harsh interrogation of terrorism suspects during the Bush administration.

Obama has already said his administration would not prosecute CIA interrogators who relied in good faith on legal opinions issued after the September 11 attacks to justify methods such as waterboarding and prolonged sleep deprivation.

However, during a question-and-answer session with reporters on Tuesday, he did not rule out charges against those who wrote the opinions justifying the methods used on captured terrorism suspects, which human rights groups call torture.

With respect to those who formulated those legal decisions, I would say that is going to be more of a decision for the attorney general within the parameters of various laws, and I don't want to prejudge that, Obama said after meeting Jordan's King Abdullah.

I think that there are a host of very complicated issues involved there, he said.

Obama's release last week of classified documents detailing an interrogation program that included waterboarding, sleep deprivation and other techniques has stirred an intense debate in the United States over whether legal action should be taken against those involved.

Several lawmakers in Obama's Democratic party are calling for public investigations into the program and contend that Obama should not rule out prosecutions under anti-torture laws.

Human rights advocates say charges are needed to prevent future abuses and hold people accountable.

The Obama administration has said it would try to shield CIA employees from any international or foreign tribunal -- an immediate challenge to Spain, where a judge has threatened to investigate Bush administration officials.