Civil liberties advocates on Friday asked a federal court here to end the National Security Agency counterterrorism program that collects data on billions of phone calls by Americans, arguing that it violates the Constitution and was not authorized by Congress.

The case was brought by the American Civil Liberties Union after the publication in June of a court order to Verizon Business Network Services that showed the phone company was required to turn over to the NSA all call detail records of its customers, including the length and time of calls but not the content.

The sweeping nature of that collection, which was placed under court supervision in secret in May 2006, set off a furious public discussion over whether the agency’s efforts to thwart terrorist attacks have overstepped the legal and common-sense boundaries of privacy.

The ACLU, which is a Verizon Business customer, said the NSA program violates the Constitution’s guarantees of privacy and of freedom of association. In the most significant legal challenge to the NSA’s collection, the ACLU also said that the program, which covers all major phone companies, exceeds the scope of its authorizing legislation. That statute, Section 215 of the Patriot Act, was passed in the weeks after the Sept. 11, 2001, terrorist attacks.

“This vast dragnet is said to be authorized by Section 215 of the USA Patriot Act, but nothing in the text or legislative history of that provision remotely suggests that Congress intended to empower the government to collect information on a daily basis, indefinitely, about every American’s phone calls,” said Jameel Jaffer, one of two ACLU attorneys arguing the case before U.S. District Judge William H. Pauley III in lower Manhattan.

A Justice Department attorney countered that the program is constitutional and that Congress was fully informed when it authorized and reauthorized Section 215. Moreover, he said, the ACLU has no standing to bring the case because it cannot prove that its members have been harmed by the NSA’s use of the data.

“The program is carefully calibrated for the purpose [of counterterrorism] and is not the kind of indiscriminate use of the data that the plaintiffs suggest,” said Assistant Attorney General Stuart F. Delery.

In just over two hours of arguments, Pauley showed some skepticism of the government’s assertion that Congress really understood it was approving a mass call-tracking program when it reauthorized the Patriot Act in 2010 and 2011.

Delery argued that Congress was provided classified briefings and papers laying out the program’s scope. He also said intelligence committees of both houses, which “stand in the shoes of the public,” were fully briefed.

Pauley noted, however, that “a veteran congressman,” Rep. F. James Sensenbrenner Jr. (R-Wis.), submitted an amicus brief in the case “in which he said he had no idea of what was happening” when he voted to reauthorize Section 215.

Delery argued that the ACLU’s claims of harm are “speculative” because it had no evidence that the NSA ever reviewed any of its members’ call records or that anyone was dissuaded from calling the civil liberties group because of fear their calls would be monitored.

He also said that the program was constitutional because the Supreme Court in a 1979 case, Smith v. Maryland, concluded that phone records of the sort at issue here were not protected by the Fourth Amendment. He said that the program was useful and necessary “to find connections between known and unknown terrorists” and “unless you can collect records over time” and across carriers, the NSA’s analytic tools to identify those connections would not work effectively.

But Alex Abdo, another ACLU lawyer, argued that the mere fact that the organization’s records were collected on a sustained basis is an invasion of privacy under the Fourth Amendment. He said that the Supreme Court in 1979 was not addressing mass collection but rather the calls of one suspect over a few days.

Jaffer also argued that if the government’s view of the statute is upheld, then the door is open to the bulk collection of other types of records under other legal authorities — not just Section 215.

“The Supreme Court has admonished many times that the Congress doesn’t hide elephants in mouse-holes,” he said. “I think that’s what the government is proposing here.”