MARTINSBURG, W.VA. -- Trucks filled with boxes of gun-sales records pull up almost daily to a one-story brick building nestled in the hills outside this blue-collar town. Inside, workers armed with Scotch tape and magnifying glasses huddle over their desks, trying to decipher pieces of paper to trace the paths of guns used in crimes.

The National Tracing Center is the only place in the nation authorized to trace gun sales. Here, researchers with the Bureau of Alcohol, Tobacco, Firearms and Explosives make phone calls and pore over handwritten records from across the country to track down gun owners. In contrast with such state-of-the-art, 21st-century crime-fighting techniques as DNA matching and digital fingerprint analysis, gun tracing is an antiquated, laborious process done mostly by hand. The government is prohibited from putting gun ownership records into an easily accessible format, such as a searchable computer database.

For decades, the National Rifle Association has lobbied successfully to block all attempts at such computerization, arguing against any national registry of firearm ownership.

"Those who wonder what motivates American gun owners should understand that perhaps only one word in the English language so boils their blood as 'registration,' and that word is 'confiscation,' " according to an NRA fact sheet.

Concerns about government regulation of gun ownership have limited the resources available to the ATF, led to strict regulatory restrictions and left the agency without leadership, according to interviews with dozens of former and current ATF officials and examination of thousands of pages of internal documents. The agency still has about the same number of agents it had nearly four decades ago: 2,500. The firearms bureau inspects only a fraction of the nation's 60,000 retail gun dealers, taking as much as eight years between visits to stores. By law, the ATF cannot require dealers to conduct a physical inventory to determine whether any guns have been lost or stolen.

The ATF is supposed to regulate the gun industry, but many within the bureau say it is the industry that dominates the agency. Unlike the FBI, the Drug Enforcement Administration, the Secret Service or the U.S. Marshals, the ATF must contend with a powerful lobby that watches its every move and fights its attempts to gain resources and regulatory power.

This year's appropriations bill for several key law enforcement agencies reveals the limits imposed by Congress on the ATF. For the FBI, there are 19 lines of congressional direction. For the DEA, there are 10. For the ATF, there are 87 lines, including the requirement to keep the gun-tracing database hidden from the public.

"We're a political football," said James Cavanaugh, who recently retired as special agent in charge of the ATF's Nashville office after a 30-year career.

The NRA, which has about 4 million members, said its work over the years pushing legislation in Congress has been designed to protect the constitutional rights of gun owners and has not hampered law enforcement.

The ATF "should focus their efforts on prosecuting bad people and not harassing gun dealers and, in a lot of cases, gun owners," said Chris W. Cox, executive director of the NRA Institute for Legislative Action. "The only reason to register products is either to tax 'em or to take 'em."

Gun tracers 'overwhelmed'

The ATF allowed The Washington Post a rare visit to its secure tracing center in Martinsburg, about 90 miles from Washington, providing insight into an archaic process that Cavanaugh likens to a "horse and buggy."

Tracing is an invaluable tool for law enforcement. ATF researchers at the center answer more than 300,000 queries a year from police who recover guns at crime scenes and want to know where they came from.

When police contact the ATF, tracing specialists take identifying information about the gun, such as the serial number, make and model. In most cases, they have to contact the gun's manufacturer to find out where it was shipped from the factory. The researcher then follows the distribution chain to find the retail dealer that first sold the weapon. The researcher calls the dealer to get the identity of the first buyer, whose name should be on an ATF form "4473," the three-page buyer questionnaire that dealers are required to keep on file.

Dealers are also required to report to the ATF when someone buys more than one handgun from them within five consecutive business days, a red flag for potential trafficking. The gun lobby has opposed a similar requirement for rifles and shotguns - a dealer can sell the same purchaser dozens of semiautomatic rifles, such as AK-47s, and not be required to report the sales.

"They're less likely to be used in crime," said John C. Frazier, director of the NRA's Institute for Legislative Action.

Depending on how well a dealer keeps records, a firearms trace can take hours or weeks. But one-third of all gun traces come from the records of out-of-business gun dealers. In those cases, there is no one to call.

When firearms dealers close, they are required to box up their records and send them to the Martinsburg tracing center. Charles Houser, who oversees the center, and his staff are inundated by the thousands of boxes of records that come in on the trucks each month. They are stacked high along the walls and between cubicles. Last year, the backlog of boxes waiting to be sorted and digitally copied reached 12,000.

"I was absolutely appalled and depressed at what they are going through out there," Rep. Alan B. Mollohan (D-W.Va.), chairman of the House Appropriations Subcommittee on Commerce, Justice and Science, told ATF officials at a hearing this year. "Literally you see pallets of these records come in, and they're just absolutely overwhelmed."

ATF employees, many of them hunkered over folding tables, go through a tedious process of sorting, stacking, cataloguing and deciphering. From the boxes, they pull out gun-sales records on ink-smeared, yellowed index cards and dog-eared ledger books filled with faded pencil. If they are lucky, they find 4473s written in clear, legible handwriting. Inside the dealer's boxes, workers sometimes find ammunition, the odd gun part - or rat feces. Some records have languished in attics for decades. Others have been underwater.

"Katrina was a mess," Houser said.

Gun dealers all over the Gulf Coast region were driven out of business by the hurricane, and they sent their wet and mildewing records to Martinsburg. For months, paper files sat in the center's parking lot, drying in the sun.

The difficulties at the tracing center have slowed efforts to trace guns seized from crime scenes all over the country - as well as in Mexico, where most of the seized weapons come from U.S. gun dealers, according to congressional reports.

Traces are most useful within the first few days, but it took the ATF an average of about two weeks to complete traces of firearms recovered in Mexico between 2004 and 2008, according to a congressional report last year on the ATF's efforts to combat arms trafficking to that country. In addition, the Justice Department's Office of the Inspector General said the ATF doesn't have enough Spanish-speaking personnel and has been slow in developing a tracing system in Spanish.

Agency without a leader

In addition to its problems with recordkeeping, the ATF, with a $1.4 billion budget, has not had a confirmed director in four years.

The problem started soon after Attorney General John D. Ashcroft appointed Carl J. Truscott, a veteran Secret Service official, to head the bureau in 2004. After Truscott took the helm, Congress moved to make the ATF directorship comparable to that of the directors of the DEA and the FBI, who must be confirmed by the Senate. In an interview, Truscott said the move was also backed by the Justice Department and was possibly an effort to boost the prestige and clout of the position.

Truscott resigned in 2006, accused of taking expensive trips with ATF agents, including a $37,000 journey to London. He spent $140 million to build a 438,000-square-foot headquarters on New York Avenue and planned to install a $65,000 conference table.

Meanwhile, the change requiring Senate confirmation for an ATF chief allowed the gun lobby to have a say on Capitol Hill about the agency's leadership.

Next up for the ATF job was Michael J. Sullivan, a former U.S. attorney in Boston nominated by President George W. Bush. He was blocked by three senators who accused the ATF of being hostile to gun dealers: David Vitter (R-La.), Michael D. Crapo (R-Idaho) and Larry E. Craig (R-Idaho). Craig, who has left office, was a member of the NRA's board of directors throughout his tenure in the Senate.

They succeeded in keeping Sullivan in "acting" limbo until he resigned when Barack Obama took office.

As president, Obama has yet to nominate a new director. In April 2009, the job of acting director was given to Kenneth Melson, a former Virginia prosecutor and director of the Justice Department's Executive Office for U.S. Attorneys. But Melson was demoted to deputy director under the Vacancies Reform Act, which limits how long acting chiefs can run federal agencies. He still runs the agency, but the top job sits vacant.

In August, sources in the ATF said Andy Traver, a special agent in charge of the ATF in Chicago, was being considered for the job. Gun-lobby representatives immediately said they would oppose his nomination because they thought he was too close to gun-control activists.

Lack of resources

In 1972, when the ATF separated from the Internal Revenue Service and became its own bureau within the Treasury Department, it had about 2,500 agents. At the time, the FBI had 8,700, the DEA 1,500 and the U.S. Marshals 1,900.

Thirty-eight years later, the FBI is up to 13,000, the DEA has more than tripled to 5,000, and there are 3,300 federal marshals.

The ATF, now a part of the Justice Department, remains at 2,500.

"We were always given just enough food and water to survive," said Michael Bouchard, former ATF assistant director for field operations. "We could barely just keep going. The ATF could never get that strong, because the gun lobby would get too concerned."

The NRA said it has not lobbied against resources for the ATF.

"We have not always agreed with some of ATF's priorities," Cox said. "We want to help ATF focus on its core mission . . . which is finding, apprehending, arresting and punishing people who break the law."

In defense of its role investigating gun crime, the ATF pointed out that last year its agents made 10,892 arrests, including bringing cases against 4,076 gang members.

But the ATF does not have enough personnel to fully inspect the firearms and explosives dealers under its charge. The bureau has about 600 inspectors to cover more than 115,000 firearms dealers - about 55,000 collectors and about 60,000 retail sellers.

Justice Department Inspector General Glenn Fine found in 2004 that the ATF had inspected only 4.5 percent of U.S. gun dealers and rarely shuts one down. At that rate, he noted, inspecting all the dealers would take more than 22 years.

Former ATF official James Zammillo said that when he assumed the newly created role of deputy assistant director of industry operations in the wake of the inspector general's report, he took steps to expedite and streamline oversight. He said he prioritized dealers for inspection in three- and five-year cycles based on several factors, including analysis of their gun traces and compliance histories.

Since the report, the ATF has stepped up the pace of inspections, going from 5,000 in 2005 to 11,000 in 2009. By law, the ATF can inspect dealers for compliance only once a year. But despite improvements, officials acknowledge that, on average, dealers are inspected only about once a decade.

"We are under-resourced," Melson said earlier this year at a Las Vegas gun show for manufacturers and dealers. "We don't have the people to do inspections every three years. It takes eight to nine years to inspect."

The ATF's hands are often tied when it comes to regulating dealers, according to interviews with current and former agency officials, as well as thousands of pages of internal files obtained through Freedom of Information Act requests.

When inspectors document persistent or severe violations, they can issue warning letters or hold warning conferences with licensees. When problems are critical, they can move to take away the license. Dealers, however, can drag out the process for years and sell guns the entire time, The Post found.

On average, the agency revokes or denies renewal of 110 licenses annually, records show. Another 160 licenses on average are surrendered by dealers threatened with revocation. Overall, that's less than one-half of 1 percent of licensed dealers. Criminal prosecutions of corrupt dealers are even more rare, about 15 in a typical year, records show. Simply opening an investigation of a gun dealer requires clearing high bureaucratic hurdles, including the writing of a detailed proposal that must be approved by supervisory agents.

"It's a lot easier to close a restaurant kitchen than a gun store," said Lew Raden, the former ATF assistant director for enforcement.

Avoiding closure

Willingham's Sports in western Alabama found a way to stay open even after the ATF revoked its license. Along a stretch of a highway in the small, riverfront city of Demopolis, the store lost track of more than 180 guns and failed more than 700 times to correctly log firearm sales over a dozen years, records show. The ATF took the rare step in early 2002 of moving to revoke the store's license.

But licensee Jimmie R. Willingham appealed through the agency's internal process. He told an ATF hearing officer that he didn't mean to break the law.

The case wound through ATF channels for two years before the revocation was upheld. Willingham then turned to the courts. Almost a year and a half passed after that. It was mid-2005 before a federal judge and a court of appeals had both ruled for the ATF.

"Willingham carelessly disregarded its recordkeeping obligations under the Gun Control Act for more than a decade," the district judge said.

The ATF repeatedly authorized Willingham to sell guns while the revocation played out. Finally, in August 2006, more than a year after the courts ruled in favor of the ATF, Willingham's license extensions lapsed.

The ATF visited to make sure Willingham understood that his license was no longer valid. He told them he was transferring his inventory to his father, who had worked with him at the shop and had secured his own ATF dealer's license for the location. ATF inspectors reported that the father told them he would operate his gun business "inside his son's sporting-goods store."

To obtain a license, applicants need to be 21, cannot have ever been prohibited from owning a gun - as with felons and certain people with disabilities - and must have a fixed address. Initial fees are $200. Licenses last three years. In contrast with the years the agency may spend revoking a license, the ATF by law must approve eligible applicants in 60 days.

Jimmie Willingham declined requests to discuss the licensing matter.

"I'm the owner. I call the shots," he said. "In this day and time I don't want to [tick] them off any more than needs to be. It is worse than dealing with the IRS."

Willingham's Sports has not been inspected since the ATF licensed the father in 2006, records show.

Missing firearms

One of the ATF's chief concerns is missing guns. Guns that stores cannot account for cannot be traced to buyers and are a red flag for potential off-the-books dealing.

Nationwide, dealers lose track of an enormous number of guns. Since 2005, 3,847 inspections have documented 113,642 guns that cannot be found. (The Bushmaster rifle used in the D.C. sniper killings in 2002 had gone missing from a gun store in Tacoma, Wash.)

The process is complicated because dealers by law do not have to take inventory. In a 2003 provision authored by Rep. Todd Tiahrt (R-Kan.), Congress prohibited the ATF from requiring dealers to do inventories. As a result, ATF inspectors sometimes have to spend days or weeks poring through a dealer's paperwork and physically matching it to the guns on hand.

"An annual inventory is part of every business," said Zammillo, who retired this year after four decades with the ATF. "Congress said we forbid you to require a business to take an inventory.

"There is a clear need for it for public safety, based on the number of missing guns."

The NRA said requiring inventories would impose a huge cost on the industry and raise prices for consumers.

New legislation, pending before Congress, would further limit the agency's ability to regulate dealers, former and current ATF officials said. Pushed by the gun lobby and called the "ATF modernization bill," it would require a higher standard to prove violations by dealers. The agency, for the first time, would have to show that a dealer knew the law and intentionally disregarded it; in other words, the ATF would have to establish the dealer's state of mind at the time of the violation.

The NRA said the law is necessary because dealers often are harshly punished for trivial paperwork errors.

"ATF always has had and should always have the ability to punish dealers who have willfully broken the law, but short of that we have to inject some common sense," Cox said.

But Zammillo said that inadequate manpower and restrictions on what the ATF can require of dealers have boxed in the agency, and that some of the new legislative proposals would make things worse.

"Congress has tied the hands of the agency that they've charged with protecting the public," he said.

horwitzs@washpost.com grimaldij@washpost.com

Contributing to this report were staff writer David S. Fallis, staff research editor Alice Crites and staff researcher Julie Tate.