A federal appeals court in the District of Columbia heard oral arguments Tuesday over the constitutionality of the National Security Agency’s mass collection of data about millions of Americans’ phone calls.

The three-judge panel wrestled with key questions, including at what point a person’s privacy rights become relevant — when the government gathers records known as metadata or when an analyst reviews the material. They pressed attorneys on whether a 1979 Supreme Court case about privacy rights in phone-call data applies to the NSA program.

The judges also questioned whether the plaintiff, legal activist Larry Klayman, a customer of Verizon Wireless, could bring suit if he could not prove his records were obtained by the NSA. The government has acknowledged that only one Verizon subsidiary — Verizon Business Network Services — has turned over data. Separately, sources have said that the government never sought Verizon Wireless’s participation in the NSA program.

The roughly 90-minute session came two months after an appeals court in New York heard arguments in a separate constitutional challenge to the NSA collection — reflecting an apparent willingness of the judiciary to weigh the legality of certain government surveillance programs at a time when Congress seems unable to push through reforms.

At issue is a major counterterrorism program launched in secret after the 2001 terrorist attacks, put under court supervision in 2006 and revealed last year through a document leaked by former NSA contractor Edward Snowden. Klayman, the founder of Freedom Watch, filed suit shortly after the revelation, charging that the program violated Americans’ constitutional rights.

U.S. District Judge Richard J. Leon found in Klayman’s favor in December, saying the “almost-Orwellian” program “almost certainly” violated the Fourth Amendment. He issued a preliminary injunction, which he stayed, pending appeal.

The cases in New York and Washington, as well as a similar one in Seattle, are moving as Congress enters a lame-duck session in which legislation to curtail the program — drafted at President Obama’s urging — appears stalled. If lawmakers fail to act now, Congress will eventually be forced to address the issue because the underlying law that the government uses to justify the program expires in June.

Under that law, Section 215 of the USA Patriot Act, the NSA has been retrieving every day from U.S. phone companies the call logs of millions of Americans: numbers dialed, call length and time, but not call content. Analysts may review the records of numbers they reasonably suspect are linked to foreign terrorists.

“There is no protected constitutional interest that’s been invaded by the mere collection of the business records of a telephone company,” said H. Thomas Byron III, an attorney with the Justice Department’s civil division. Byron said the intrusion occurs only when an analyst actually reviews the data, and that, he said, happens only a small fraction of the time. He added that even if the gathering of data violates Americans’ privacy, the restrictions that have been added by the Foreign Intelligence Surveillance Court make that intrusion reasonable.

Klayman argued that the mere collection, given its scale and duration, violates the Fourth Amendment, which guarantees that Americans be free from unreasonable searches.

But Judge Stephen Williams appeared skeptical, suggesting that he agrees with the government that the intrusion occurs not when the NSA collects the data, or queries it, but at “the third step,” when the analysis begins.

Byron argued that under the 1979 ruling in Smith v. Maryland, Americans have no expectation of privacy in metadata, the information that phone companies log to keep track of use by their customers. “It’s very clear that this information is owned by the telephone company, not by the subscribers themselves,” he said.

Judge Janice Rogers Brown called such a distinction a “nice bright line,” but she wondered whether it was valid. In a case involving medical records, she noted, the Supreme Court ruled that people have privacy rights in data about them held by a hospital.

In the 1979 case, the court found that a criminal defendant had no expectation of privacy in the phone numbers he dialed, and it upheld the police’s retrieval of that data without a warrant over a period of three days.

Klayman and several privacy groups argue that the 1979 case is a poor fit for the NSA program. Unlike the case of Smith, a robber who made threatening phone calls to his victim, the NSA program involves the “untargeted mass collection of the communication patterns of millions of people over many years,” said Cindy Cohn, legal director of the Electronic Frontier Foundation, which, along with the American Civil Liberties Union, filed a friend-of-the-court brief in support of Klayman. “The government is trying to cram a very much larger program . . . into a pretty tiny box in Smith.”

Cohn argued that the government’s position — “don’t worry, they’re collecting everything because their protocols keep [people] safe” — is not sufficient. If that were the case, she said, “it would mean that the government could record every phone call, photocopy all the mail, demand all the membership lists of organizations and put a video camera in every bedroom and [say] it doesn’t matter because they’ve got protocols and rules that say they can do it.”

Paul Smith, an attorney for the Center for National Security Studies, argued that the NSA program violated Section 215.