WASHINGTON (AP) — The National Security Agency considered abandoning its secret program to collect and store American calling records in the months before leaker Edward Snowden revealed the practice, current and former intelligence officials say, because some officials believed the costs outweighed the meager counterterrorism benefits.

After the leak and the collective surprise around the world, NSA leaders strongly defended the phone records program to Congress and the public, but without disclosing the internal debate.

The proposal to kill the program was circulating among top managers but had not yet reached the desk of Gen. Keith Alexander, then the NSA director, according to current and former intelligence officials who would not be quoted because the details are sensitive. Two former senior NSA officials say they doubt Alexander would have approved it.

Still, the behind-the-scenes NSA concerns, which have not been reported previously, could be relevant as Congress decides whether to renew or modify the phone records collection when the law authorizing it expires in June.

The internal critics pointed out that the already high costs of vacuuming up and storing the “to and from” information from nearly every domestic landline call were rising, the system was not capturing most cellphone calls, and program was not central to unraveling terrorist plots, the officials said. They worried about public outrage if the program ever was revealed.

After the program was disclosed, civil liberties advocates attacked it, saying the records could give a secret intelligence agency a road map to Americans’ private activities. NSA officials presented a forceful rebuttal that helped shaped public opinion.

Responding to widespread criticism, President Barack Obama in January 2014 proposed that the NSA stop collecting the records, but instead request them when needed in terrorism investigations from telephone companies, which tend to keep them for 18 months.

Yet the president has insisted that legislation is required to adopt his proposal, and Congress has not acted. So the NSA continues to collect and store records of private U.S. phone calls for use in terrorism investigations under Section 215 of the Patriot Act. Many lawmakers want the program to continue as is.

Alexander argued that the program was an essential tool because it allows the FBI and the NSA to hunt for domestic plots by searching American calling records against phone numbers associated with international terrorists. He and other NSA officials support Obama’s plan to let the phone companies keep the data, as long as the government quickly can search it.

Civil liberties activists say it was never a good idea to allow a secret intelligence agency to store records of Americans’ private phone calls, and some are not sure the government should search them in bulk. They say government can point to only a single domestic terrorism defendant who was implicated by a phone records search under the program, a San Diego taxi driver who was convicted of raising $15,000 for a Somali terrorist group.

Some fault NSA for failing to disclose the internal debate about the program.

“This is consistent with our experience with the intelligence community,” said Rep. Justin Amash, R-Mich. “Even when we have classified briefings, it’s like a game of 20 questions and we can’t get to the bottom of anything.”

The proposal to halt phone records collection that was circulating in 2013 was separate from a 2009 examination of the program by NSA, sparked by objections from a senior NSA official, reported in November by The Associated Press. In that case, a senior NSA code breaker learned about the program and concluded it was wrong for the agency to collect and store American records. The NSA enlisted the Justice Department in an examination of whether the search function could be preserved with the records stores by the phone companies.

That would not work without a change in the law, the review concluded. Alexander, who retired in March 2014, opted to continue the program as is.

But the internal debate continued, current and former officials say, and critics within the NSA pressed their case against the program. To them, the program had become an expensive insurance policy with an increasing number of loopholes, given the lack of mobile data. They also knew it would be deeply controversial if made public.

By 2013, some NSA officials were ready to stop the bulk collection even though they knew they would lose the ability to search a database of U.S. calling records. As always, the FBI still would be able to obtain the phone records of suspects through a court order.

There was a precedent for ending collection cold turkey. Two years earlier, the NSA cited similar cost-benefit calculations when it stopped another secret program under which it was collecting Americans’ email metadata — information showing who was communicating with whom, but not the content of the messages. That decision was made public via the Snowden leaks.

Alexander believed that the FBI and the NSA were still getting crucial value out of the phone records program, in contrast to the email records program, former NSA officials say.

After the Snowden leaks, independent experts who looked at the program didn’t agree. A presidential task force examined NSA surveillance and recommended ending the phone records collection, saying it posed unacceptable privacy risks while doing little if anything to stop terrorism. The task force included Michael Morell, a former deputy CIA director, and Richard Clarke, a former White House counter terrorism adviser.

“We cannot discount the risk, in light of the lessons of our own history, that at some point in the future, high-level government officials will decide that this massive database of extraordinarily sensitive private information is there for the plucking,” the report said. Times, dates and numbers called can provide a window into a person’s activities and connections.

A separate inquiry by the Privacy and Civil Liberties Oversight Board concluded the same thing.

David Medine, chairman of that board, said the concerns raised internally by NSA officials were the same as theirs, yet when NSA officials came before the privacy board, they “put on a pretty strong defense for the program. Except their success stories didn’t pan out,” he said.

Copyright 2015 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.