On the campaign trail, Mr. Trump makes a show of embracing the association and its leadership, while accusing Mrs. Clinton of seeking to do away with the Second Amendment.

“We’re going to help the N.R.A., who are great people,” he said on Tuesday in Fayetteville, N.C. “They’re fighting hard, they’re fighting hard. Chris and Wayne and all their people at the N.R.A., these are people that love our country.”

The alliance with Mr. Trump comes at a moment of peril for the N.R.A. and its agenda, as Democrats threaten to take control of the Senate and polls show the public increasingly supportive of at least modest new limits on the sale and possession of firearms.

Mrs. Clinton and other Democrats have run explicitly against the N.R.A. in this election, attacking the gun lobby for opposing laws intended to restrict gun sales to people with mental illnesses or whose names are on the federal terrorism watch list. They have held up the N.R.A. as a uniquely sinister organization, and cast themselves as opponents of the group rather than of gun owners in general.