The day before the House of Representatives began considering gun control last week, James Jay Baker sat in his office over a Capitol Hill saloon calculating vote counts for different versions of a bill requiring background checks on firearms sales at gun shows.

"We have to be ready for anything," said the chief lobbyist for the National Rifle Association. "But," he added a moment later, "nothing is better than anything."

Nothing is exactly what the House produced with yesterday's vote to reject new gun show background checks, handing the NRA its most dramatic legislative victory in years. For Baker, the vote confirmed his return from four years of exile imposed by NRA hard-liners who thought him too willing to compromise with gun control advocates. The outcome was particularly sweet for Baker because it was engineered with the help of an old ally who also had been squeezed out of the NRA inner circle, Rep. John D. Dingell (D-Mich.).

From the outset of the House debate, it was clear the NRA would play a key role. When House Republicans unveiled their gun show proposal on June 7, President Clinton immediately denounced it as "ghostwritten by the NRA" and claimed it would gut the gun show bill adopted by the Senate in May. At the time, Baker and GOP leaders knew that Dingell had already drafted an amendment to the Republican bill that would further weaken the Senate provision and make the package much more to the NRA's liking, according to congressional officials and other sources.

"From the beginning Republicans knew that John Dingell, the most senior Democrat in the House, would be there to give them cover from Clinton, the gun control groups or anyone else who wanted to make this a partisan issue," said a source familiar with the deal.

In the end, it was the amendment crafted by Dingell and the NRA that killed the gun legislation in the House. On the surface, the proposal satisfied the demand that all firearm sales at gun shows be subject to criminal background checks. But it did this in a way that would weaken the system of background checks that applies to a majority of gun show sales.

Under current law, unlicensed dealers at gun shows are not required to perform background checks, but licensed dealers, who account for the majority of gun show sales, must perform checks that can take up to three business days. In the guise of extending gun show background checks to cover unlicensed sellers, critics charged, Dingell's proposal would instead drastically weaken the system by slashing the time allowed to 24 hours.

With the encouragement of President Clinton and Attorney General Janet Reno, Democrats turned on the final gun show legislation, and it was defeated 280 to 147.

The outcome on the House floor yesterday was the culmination of an NRA lobbying campaign that spent $1.5 million in May and June, including $750,000 for mailings to members nationwide, $300,000 for phone bank operations and an extensive media buy of ads on conservative radio talk shows.

Letters warning of dire consequences and urging quick action poured out of Baker's office to NRA members. The organization broadcast commercials in selected congressional districts against gun control. As the showdown approached, numerous NRA lobbyists were available on Capitol Hill to press the association's point of view on wavering House members.

The NRA's ample supply of money made this possible, but it was buttressed by something of equal importance in such a legislative battle -- a committed and intense membership that was eager to respond to Baker's entreaties. "An individual lobbyist is only as strong as his or her backup," said Sen. Larry E. Craig (R-Idaho), an NRA board member who led the opposition to new gun laws in the Senate. "The backup is the ability to turn on the telephones and flood the mailboxes."

Rep. Peter A. DeFazio (D-Ore.), whose district includes Springfield, site of one of the school shootings that gave momentum to the drive for additional gun control legislation, said calls to his office were running 100 to 1 against the Senate-passed measures. Rep. Ray LaHood (R-Ill.) put the ratio of calls to his office at 300 to 1 against.

The lobbying campaign prompted expressions of admiration even from NRA critics.

"The NRA does the best job of any group in lobbying members," said Rep. Barney Frank (D-Mass.), a strong gun control proponent. "They don't have marches, they don't have demonstrations, they don't shoot their guns in the air. It's just good, straight democracy."

"We're up against the best lobby in town," added House Minority Leader Richard A. Gephardt (D-Mo.) as the critical votes approached. "The NRA has a very effective phone tree. My hat is off to them. I admire them. They sure know how to do it."

Gephardt estimated that 80 percent of the public favored the Senate-passed gun measures and that of the remaining 20 percent, perhaps only 2 percent were so strongly opposed to gun control laws that they would base their next vote for their representative in Congress on that issue alone.

But, Gephardt said, "you lose 2 percent on that issue and you could be gone."

Democrats were reminded of that lesson in 1994 when they lost control of the House for the first time in 40 years, in part because of passage of the Brady handgun law in 1993. The victims included then-Speaker Thomas S. Foley (D-Wash.) and then-Judiciary Committee Chairman Jack Brooks (D-Tex.), whose longtime ties to the NRA did not protect them from the wrath of gun owners in their districts after they voted for the Brady law.

With that as the background, a senior House Democratic aide said this week's battle may have been lost several weeks ago when the House GOP leadership rebuffed Democratic demands for immediate action on the Senate gun package and scheduled the showdown for after the Memorial Day recess.

"That is the way they do business," he said. "They needed time to send their mailings. That was the game -- giving skilled professionals the time they needed."

Chief among the NRA's skilled professionals in this fight has been Baker, 45, a lawyer who has worked for the organization since 1980 and who bears some of the scars of battles past. Baker is executive director of the NRA's Institute for Legislative Action, a position he held from 1991 to 1994 and resumed last year.

Baker's 1994 departure as the NRA's chief lobbyist came after passage of the Brady law and was widely seen as the result of unhappiness among hard-liners in the organization over enactment of the measure that mandated a waiting period for the purchase of a handgun.

"It seemed to us kind of like a purge," recalled Bob Walker, president of Handgun Control Inc. who, as that organization's chief lobbyist in 1993, went toe to toe with Baker over the Brady bill. "The word was there was a lot of dissatisfaction with how the NRA handled the Brady bill. I think they were looking for a fall guy and I think Baker was the fall guy."

When Baker was brought back to the chief lobbying position in 1998, he replaced Tanya Metaksa, an abrasive hard-liner. "We consider him to be more subtle and therefore more dangerous than Ms. Metaksa," said Naomi Paiss, communications director of Handgun Control. "She had the subtlety of a blowtorch."

"He knows how to activate the grass roots and he knows how to get them fired up," LaHood said. "They're fired up now."

Baker also had an ally in Dingell, the House's senior Democrat and a former NRA board member. Working with Baker and other NRA officials, Dingell crafted his amendment, extending background checks to all sales at gun shows but also drastically curtailing the time allowed for the checks.

Hours before the critical vote, Dingell was asked what good would be accomplished if his amendment was accepted but then the entire gun bill was rejected by the House. The 43-year congressional veteran replied: "That's an entirely defensible scenario. I think a lot of sportsmen would be happy."