The National Security Agency's bulk phone record collection program was dealt a blow Thursday as a federal appeals court said the controversial program exceeds what Congress has allowed and urged lawmakers to step in. 

A three-judge panel of the 2nd U.S. Circuit Court of Appeals in Manhattan permitted the National Security Agency program to continue temporarily as it exists, and all but pleaded for Congress to better define where the boundaries exist. 

"In light of the asserted national security interests at stake, we deem it prudent to pause to allow an opportunity for debate in Congress that may (or may not) profoundly alter the legal landscape," the opinion written by Circuit Judge Gerald Lynch said. 

Attorney General Loretta Lynch and other Obama administration officials said they are reviewing the decision, while civil liberties-minded lawmakers cheered the ruling. 

"This is a monumental decision for all lovers of liberty," Sen. Rand Paul, R-Ky., a Republican presidential candidate, said in a statement. 

More On This...

The ruling comes at a key time, with relevant provisions of the Patriot Act set to expire June 1 and Congress debating potential changes. 

Paul on Thursday reiterated his call for Congress to repeal the relevant Patriot Act provisions. The House is planning a vote on the USA Freedom Act, a bill that would effectively end bulk data collection and curb other provisions of the Patriot Act. But in the Senate, Majority Leader Mitch McConnell has said he's pursuing a "clean" extension of the law. 

Thursday's ruling said that if Congress decides to authorize the collection of data as it is done now, "the program will continue in the future under that authorization." 

But the judges added: "If Congress decides to institute a substantially modified program, the constitutional issues will certainly differ considerably from those currently raised." 

The appeals judges said the issues raised in a lawsuit by the American Civil Liberties Union illustrated the complexity of balancing privacy interests with the nation's security. 

A lower court judge in December had thrown out the case, saying the program was a necessary extension to security measures taken after the Sept. 11, 2001, terror attacks. The appeals court, which heard two hours of arguments by lawyers in December, said the lower court had erred in ruling that the phone records collection program was authorized in the manner it was being carried out. 

During the December arguments, the judges said the case would likely be decided by the U.S. Supreme Court. 

A spokesman with the White House National Security Council said they are "evaluating the decision. " 

The spokesman stressed that President Obama "has been clear that he believes we should end the Section 215 bulk telephony metadata program as it currently exists by creating an alternative mechanism to preserve the program's essential capabilities without the government holding the bulk data," and said, "We continue to work closely with members of Congress from both parties to do just that." 

In 2013, secret NSA documents were leaked to journalists by contractor Edward Snowden, revealing that the agency was collecting phone records and digital communications of millions of citizens not suspected of crimes and prompting congressional reform. Snowden remains exiled in Russia. 

A spokeswoman for government lawyers in New York declined to comment Thursday. 

The ACLU did not immediately respond to a request for comment. 

The Associated Press contributed to this report.