SAN FRANCISCO, Aug. 15 — Three federal appeals court judges hearing challenges to the National Security Agency’s surveillance programs appeared skeptical of and sometimes hostile to the Bush administration’s central argument Wednesday: that national security concerns require that the lawsuits be dismissed.

“Is it the government’s position that when our country is engaged in a war that the power of the executive when it comes to wiretapping is unchecked?” Judge Harry Pregerson asked a government lawyer. His tone was one of incredulity and frustration.

Gregory G. Garre, a deputy solicitor general representing the administration, replied that the courts had a role, though a limited one, in assessing the government’s assertion of the so-called state secrets privilege, which can require the dismissal of suits that could endanger national security. Judges, he said, must give executive branch determinations “utmost deference.”

“Litigating this action could result in exceptionally grave harm to the national security of the United States,” Mr. Garre said, referring to the assessment of intelligence officials.