SAN FRANCISCO – An appeals court on Wednesday tossed out a convicted terrorist’s lawsuit accusing a high-ranking Bush administration lawyer who wrote the so-called “torture memos” of authorizing illegally harsh treatment of “enemy combatants.”

Former Deputy Assistant Attorney General John Yoo is protected from such lawsuits because the law defining torture and the treatment of enemy combatants was unsettled in the two years after the Sept. 11 terror attacks, when the memos were written, the 9th U.S. Circuit Court of Appeals said.

The memos have been embroiled in national security politics for years after laying out a broad interpretation of executive power.

A Yoo memo from 2001 advised that the military could use “any means necessary” to hold terror suspects. A 2002 memo to then-White House Counsel Alberto Gonzales advised that treatment of suspected terrorists was torture only if it caused pain levels equivalent to “organ failure, impairment of bodily function or even death.”

Yoo also advised that the president might have the constitutional power to allow torturing enemy combatants. Most famously, Yoo was the principal author of a memo sent to the CIA in August 2002 authorizing “waterboarding,” which simulates drowning. President Barack Obama banned its use in 2009.