WASHINGTON — The National Rifle Association has rallied gun owners — and raised tens of millions of dollars — campaigning against the threat of a national database of firearms or their owners.

But in fact, the sort of vast, secret database the NRA often warns of already exists, despite having been assembled largely without the knowledge or consent of gun owners. It is housed in the Virginia offices of the NRA itself. The country's largest privately held database of current, former, and prospective gun owners is one of the powerful lobby's secret weapons, expanding its influence well beyond its estimated 3 million members and bolstering its political supremacy.

That database has been built through years of acquiring gun permit registration lists from state and county offices, gathering names of new owners from the thousands of gun safety classes taught by NRA-certified instructors and by buying lists of attendees of gun shows, subscribers to gun magazines, and more, BuzzFeed has learned.

The result: a big data powerhouse that deploys the same high-tech tactics all year round that the vaunted Obama campaign used to win two presidential elections.

NRA spokesman Andrew Arulanandam declined to discuss the group's name-gathering methods or what it does with its vast pool of data about millions of non-member gun owners. Asked what becomes of the class rosters for safety classes when instructors turn them in, he replied, "That's not any of your business."

Others in the business of big political data, however, say the NRA is using tools similar to those employed by the campaigns of its nemesis, President Barack Obama.

"There are certainly some parallels," said Laura Quinn, CEO of Catalist, a data analysis firm used by Obama for America. "The NRA is not only able to understand people who their members are but also people who are not their members. The more data they have, the more it allows them to test different strategies and different messages on different people."

"Part of the way they have gotten to a place where they are able to do what they do is through data," Quinn said. "There is some irony."

The vast size of the NRA's database and its sophisticated methods of analyzing the public mood go a long way in explaining the organization's enduring influence. Even in an age when opinion polls show gun control measures gaining in general popularity and when wealthy benefactors like New York City Mayor Michael Bloomberg are spending millions to counter the NRA's lobbying and advertising budgets, the NRA has built-in advantages.

The NRA won't say how many names and what other personal information is in its database, but former NRA lobbyist Richard Feldman estimates they keep tabs on "tens of millions of people."

"There's nothing that prevents them from mailing those people," said Feldman, who split with the NRA in the mid-1990s and now leads the Independent Firearm Owners Association, which brands itself as a less extreme gun rights group. "The more you know about people, the more targeted the message you can communicate with them, the more the message will resonate with them."

Some data collection efforts are commonplace in politics these days, such as buying information from data brokers on magazine subscriptions and the like.

But several observers said the NRA's methods reflect a sophistication and ingenuity that is largely unrivaled outside of major national presidential campaigns. While the organization took great umbrage in December when a newspaper published the names and addresses of gun owners in two New York counties, the group for years has been gathering similar information via the same public records as a matter of course.

In Virginia, for instance, a North Carolina-based firm called Preferred Communications filed an inquiry with the Virginia State Police in July 2009 asking "on behalf of the National Rifle Association" as to whether the names of concealed carry permit holders could be purchased. The email was obtained by BuzzFeed through a Freedom of Information Act request.

"Can you please let me know if you offer 2008 and/or 2009 names?" wrote the representative, Michele Wood, who hung up on BuzzFeed when asked for comment. "Can you please let me know the address to send the check to and also whom to make it payable to?"

Iowa too provides another example. In December 2011, NRA lobbyist Christopher Rager wrote to Iowa Department of Public Safety legislative liaison Ross Loder from an official NRA email address.

"If the NRA wanted to collect data from DPS' permit holder files, is there a specific process or any rules for us to acquire the records?" Rager wrote in an email also obtained via FOIA. "Can we pay to have the files copied or sent to us?"

Similarly, officials in Arkansas and Oregon also told BuzzFeed they had requests for such lists, and Gawker reported in February of NRA-related registry requests in Louisiana and Tennessee.

"We've been doing this since the old days," Feldman said. "You could obtain from most states the listings of hunter licenses from the Department of Wildlife and Conservations. It was sort of amazing what we knew about people from that. There were early doe permit holders, black powder holders, so many different seasons. It was a lot of data."

Complementing this practice is the mining of data on the thousands who take gun safety classes from NRA-certified instructors. Arulanandam said there are 97,000 of them, a figure that impressed Quinn as a larger "army of organizers" than Obama had.

In some states, those ranks are propelled by laws that specify that taking classes from NRA-certified instructors in order to obtain permits or licenses. In 2011, for instance, the Iowa legislature added such a provision.

"Previously there was no reference to the National Rifle Association in the Iowa code," Loder said. "Before, it would have been a course offered by the local sheriff's office."

The NRA's dominance in the safety-class realm is an obvious public relations boon for the group, but it predates the organization's political activism by nearly a century. The group was founded, in fact, to improve marksmanship and teach safe, effective shooting, said NRA-certified senior trainer Mike Weisser, owner of a gun store in Ware, Massachusetts.

Yet nowadays those classes are also an important way of adding information about gun owners to the database, Weisser said.

"After people take a class, then you as an instructor can send all their names to Washington and you get credit for that," Weisser said. "If you can show you've taught enough classes, you can move up in the hierarchy as an NRA trainer."

Moving up in the hierarchy can mean being licensed to teach more types of gun safety classes and being able to charge more, he said.

"If I send the class roster in, the NRA starts sending information to these people to either join the NRA or to support NRA positions," he said. "In many of the classes, at some point, somebody will get up to give a pitch to join the NRA. Most trainers will also hand out the member application for NRA."

Most of these activities aim to convert gun owners into dues-paying NRA members or contributors to the NRA's political action committee, but Feldman said a parallel motive is to maintain a network. Political operatives who understand the new science of voter modeling regard gun ownership as a key predictor of someone's politics regardless of whether they are NRA members, and the NRA uses those non-members to extend its influence by finding just the right language and tone to speak to them, Quinn said.

Jon Bond, co-founder of the powerhouse Manhattan ad firm Kirshenbaum Bond and Partners, said it is an important reason why alternative gun-related organizations are at a huge disadvantage. Bond and his wife co-founded a new anti-violence group called Evolve to appeal to people who believe both sides of the debate are too extreme.

Bond views the NRA's grip, derived from its sophisticated data operation, as perhaps the biggest challenge to anyone else effectively influencing the political conversation.

The data "gives the NRA more power," Bond said. "It's valuable politically because what it does is, it extends the reach of its political leverage beyond NRA members. They have gun owners, not just NRA members. There's multiple purposes for it."

While the NRA's influence on Congress is most often the media's focus, the sort of microtargeting the group can do is at least as powerful in state capitals. A case in point was the successful effort to get Washington state Rep. Maureen Walsh, a Republican from Walla Walla, to remove her name from co-sponsorship of a background check bill in March.

Walsh said she was motivated by the Sandy Hook shooting to sign on to the measure, but was then deluged by more than 1,200 letters and calls from angry constituents. While many of them were from declared NRA members, she said, lots of them were from people who specified they weren't with the NRA but had been alerted by the group to the pending bill.

"They know quite a bit on that level about people in my district," said Walsh, who decided the bill had its own loophole problems and wouldn't reduce gun violence. "I don't have any doubt in my mind that they stay ahead of the game and that they put their opinions in front of" non-members who agree with them.

The NRA used the specter of a national gun registry to great effect in the debate over the Manchin-Toomey background check bill that failed last spring. Even though the bill explicitly prohibited the federal government from creating such a database, it was a talking point that senators who opposed the measure repeatedly cited.

Yet there does not seem to be the same concern among gun owners about the NRA's own efforts to amass the same information.

"It's probably partially true that people don't know the information is being collected," said Feldman, "but even if they don't know it, they probably won't care because the NRA is not part of the government."