SAN FRANCISCO (AP) — A federal appeals court on Tuesday overturned an order that the federal government pay attorney fees and damages of an Islamic group that claimed it was the target of the Bush administration's warrantless wiretap program.

The 9th U.S. Circuit Court of Appeals ruled that a lower court judge was wrong to award $40,800 in damages and $2.5 million to attorneys for the Ashland, Ore., chapter of the now-defunct Al-Haramain Islamic Foundation. The foundation waged a nearly five-year legal challenge to the Bush administration's so-called Terrorist Surveillance Program.

The appeals court ruled that the federal government is immune to such claims.

A sympathetic three-court panel said the chapter's lawyers, despite the U.S. Department of Justice's assertions otherwise, filed a legitimate lawsuit and pursued it fairly and above board.

"This case effectively brings to an end the plaintiffs' ongoing attempts to hold the executive branch responsible for intercepting telephone conversations without judicial authorization" Judge M. Margaret McKeown wrote for the unanimous panel. "However, we cannot let that occur without comment on the government's recent, unfortunate argument that the plaintiffs have somehow engaged in 'game-playing.'"

McKeown noted that the lawsuit raised important questions about balancing national security interests with civil liberties after the Sept. 11 attacks. She scolded the government for suggesting the plaintiffs' lawyers were interested in something else.

"In light of the complex, ever-evolving nature of this litigation, and considering the significant infringement on individual liberties that would occur if the Executive Branch were to disregard congressionally mandated procedures for obtaining judicial authorization of international wiretaps, the charge of 'game-playing' lobbed by the government is as careless as it is inaccurate," wrote McKeown, who was nominated to the bench by President Bill Clinton in 1998. "That their suit has ultimately failed does not in any way call into question the integrity with which they pursued it."

McKeown's two colleagues who voted with her with also Democrat appointees. Judge Harry Pregerson was appointed by President Jimmy Carter in 1979 and President Bill Clinton appointed Judge Michael Daly Hawkins in 1994.

Al-Haramain's lawyer said the judges' kind words were "small consolation" and that he and his colleagues were discussing their next steps. They could ask the appeals court to reconsider the case or ask the U.S. Supreme Court to take it up.

"If this is the last word on warrantless wiretapping then it means that there will have been no accountability for it," he said.

The Treasury Department froze the assets of the Ashland chapter and declared it a "specially designated global terrorist" on Sept. 9, 2004. Treasury officials believe the Ashland chapter delivered $150,000 overseas to support terrorist activities by the Chechen mujahedeen.

In investigating the chapter, Treasury officials accidentally turned over a document that Al-Haramain lawyers said appeared to be a top-secret call log. A judge later ordered the lawyers to turn over the document and barred them from using it to support their lawsuit. Nonetheless, they used publicly available evidence such as speeches by FBI leaders discussing the case to convince U.S. District Judge Vaughn Walker that the Oregon organization was the subject of surveillance.

Since the Department of Justice refused to address the charges in the lawsuit directly, always arguing that to do so would threaten national security by exposing state secrets, Walker awarded damages and attorney fees to Al-Haramain. The 9th Circuit said Tuesday that Walker, who has since retired, was wrong.

Generally, government investigators are required to obtain search warrants signed by judges to eavesdrop on domestic phone calls, email traffic and other electronic communications. But Bush authorized the surveillance program shortly after 9/11, allowing the National Security Agency to bypass the courts and intercept electronic communications believed connected to al-Qaida.

Bush ended the program in January 2007.