Coming in the final days of the Bush administration, the ruling was hailed by the administration and conservatives as a victory for an aggressive approach to counterterrorism. The Justice Department said in a statement that it was “pleased with this important ruling.”

“It provides a very good result; it reaffirms the president’s right to conduct warrantless searches,” said David Rivkin, a Washington lawyer who has served in Republican administrations.

Representative Peter Hoekstra of Michigan, the ranking Republican on the House Intelligence Committee, said the ruling “reinforces the significant, bipartisan political consensus” in favor of the president’s broad assertions of wiretapping powers.

But others were cautious about the significance of the ruling.

“I think this kind of maintains the status quo,” said Scott Silliman, an expert on national security law at Duke University. “I don’t think it is a surprise that the FISA court found that the legislation was constitutional. They are going to defer to Congress, especially since there was a lot of discussion when the law was passed about the ability of the government to compel providers.”

The ruling is the latest legal chapter in a dispute dating back to the aftermath of the Sept. 11 attacks, when Mr. Bush secretly ordered the National Security Agency to eavesdrop on the international communications of American citizens without the approval of Congress or the courts. After the agency’s program was publicly disclosed in December 2005, critics said it violated a 1978 law. The White House initially opposed any new legislation to regulate surveillance, arguing that it would be an infringement of the president’s powers.

But after the Democrats took control of Congress in the 2006 midterm elections, the administration agreed to bring the N.S.A. program under the jurisdiction of the FISA court. In 2007, Congress passed the Protect America Act, which was replaced in 2008 by another surveillance law.

The case arose in 2007, when a telecommunications company refused to comply with the government’s demands that it cooperate without warrants under the terms of the Protect America Act. The company was forced to comply, under threat of contempt, while it challenged the law in the FISA court, the opinion noted.