Mr. Thomasson said the courts had upheld similar regulations in the past, and noted that the rule requiring dealers to report bulk handgun sales had been imposed by the firearms agency for several years before Congress, in 1986, passed legislation codifying it as a statute.

While the suit is being paid for by the N.R.A., it is being brought in the name of the two Arizona dealers, J&G Sales of Prescott and Foothills Firearms of Yuma. The complaint said that about 8,479 licensed dealers were in the four states affected by the rule.

The two dealers had received a letter from the director of a federal firearms tracing center directing them to start reporting bulk long gun sales made after Aug. 14. But the court complaint said that complying with the rule would be costly and that the dealers could lose business from customers who would be deterred because of the loss of privacy.

The complaint also contended that the tracing center, in compiling the reports of bulk sales, might violate a separate prohibition imposed by Congress that prevents the Justice Department from keeping a centralized database of gun purchase records.

The dispute over the regulation comes at a time when the firearms bureau’s efforts to investigate straw purchasing and smuggling across the border have come under sharp Congressional scrutiny related to Operation Fast and Furious, an effort by the agency’s Phoenix division to uncover a large network of cartel-linked gunrunners.

In that operation, federal agents monitored straw buyers who bought about 2,000 guns, but did not intervene to arrest them or seize the weapons because they were trying to identify higher-ups in the network. But the bureau then lost track of many of the guns, some of which were smuggled into Mexico and two of which later turned up at the scene of a shootout in Arizona where an American Border Patrol agent was killed.