Washington

A federal judge in New York on Friday ruled that the National Security Agency's program that is systematically keeping phone records of all Americans is lawful, creating a conflict among lower courts and increasing the likelihood that the issue will be resolved by the Supreme Court.

In the ruling, Judge William Pauley, of the U.S. District Court for the Southern District of New York, granted a motion filed by the federal government to dismiss a challenge to the program brought by the American Civil Liberties Union, which had tried to halt the program.

Pauley said protections under the Fourth Amendment do not apply to records held by third parties, like phone companies.

"This blunt tool only works because it collects everything," Pauley said in the ruling. "While robust discussions are underway across the nation, in Congress and at the White House, the question for this court is whether the government's bulk telephony metadata program is lawful. This court finds it is."

A spokesman for the Justice Department said, "We are pleased the court found the NSA's bulk telephony metadata collection program to be lawful." He declined to comment further.

Jameel Jaffer, the ACLU deputy legal director, said the group intended to appeal.

"We are extremely disappointed with this decision, which misinterprets the relevant statutes, understates the privacy implications of the government's surveillance and misapplies a narrow and outdated precedent to read away core constitutional protections," he said.

The ruling comes nearly two weeks after Judge Richard J. Leon of U.S. District Court for the District of Columbia said the program most likely violated the Fourth Amendment. As part of the ruling, Leon ordered the government to stop collecting data on two plaintiffs who brought the case against the government.

In his ruling, Leon said the program "infringes on 'that degree of privacy' that the founders enshrined in the Fourth Amendment," which prohibits unreasonable searches and seizures.

While Leon ordered the government to stop collecting data on the two plaintiffs, he stayed the ruling, giving the government time to appeal the decision.

Pauley, whose courtroom is just blocks from where the World Trade Center towers stood, endorsed arguments made in recent months by senior government officials that the program might have caught the Sept. 11, 2001, hijackers had it been in place before the attacks.

In the months before Sept. 11, the NSA had intercepted several calls made to an al-Qaida safe house in Yemen. But because the NSA was not tracking all phone calls made from the United States, it did not detect that the calls were coming from one of the hijackers who was living in San Diego.

"Telephony metadata would have furnished the missing information and might have permitted the NSA to notify the Federal Bureau of Investigation of the fact that Al-Mihdhar was calling the Yemeni safe house from inside the United States," Pauley said, referring to the hijacker, Khalid Al-Mihdhar.

Pauley said that the "government learned from its mistake and adapted to confront a new enemy: a terror network capable of orchestrating attacks across the world."