Gun rights supporters hold weapons outside the Capitol office building at the state Capitol in Richmond on Tuesday. (Steve Helber/AP)

— The morning that Virginia’s legislature convened a special session on gun control, the National Rifle Association set up shop in prime real estate: the conference room belonging to Republican House Speaker Kirk Cox.

The NRA’s supply of 200 T-shirts and 250 hats quickly ran out as an army of gun rights activists stopped by. NRA officials provided directions to legislators’ offices along with some advice: Be courteous. Don’t react if protesters shout at you. Guns are allowed on the House side, not the Senate.

As it turned out, GOP leaders shut down Tuesday’s legislative session after 90 minutes without voting on any gun-control bills. It was a display of political muscle for the NRA, a brand that has appeared crippled in recent months.

The NRA’s status in American politics has seemed in doubt amid multimillion-dollar shortfalls in the organization’s budget, an ongoing investigation into its tax-exempt status by New York’s attorney general and allegations that the group has been manipulated by Russian influence-peddlers. Earlier this year its president, Oliver North, was forced out of office in a leadership tussle with chief executive Wayne LaPierre.

But this week’s events in Richmond showed that the organization continues to wield significant influence at the grass-roots level. Its legions of members — the group does not release figures but said it has “hundreds of thousands” in Virginia — are reliable voters who show up even during off-year elections.

Backed by those foot soldiers, NRA officials enjoy access to top politicians. Virginia GOP leaders spent weeks before the special session in frequent communication with NRA experts, who provided guidance and research on how gun-control measures had fared in other states, according to several people familiar with the interactions.

While Democrats were stunned by the way the GOP leadership shut down the special legislative session, the NRA knew about the move ahead of some rank-and-file Republicans.

Democrats often accuse the NRA of “buying” access, but the organization is not a big spender in Virginia. Since 2015, the NRA has given a total of $130,000 to Virginia political campaigns. Over the same period, Everytown For Gun Safety — the gun-control group founded by former New York mayor Michael R. Bloomberg — has given $4.7 million, according to the nonpartisan Virginia Public Access Project.

The NRA has contributed only $15,000 so far this election year to a handful of Republican political action committees — and that is with all 140 seats in the legislature on the November ballot and control of the General Assembly at stake. By contrast, Virginia Beer Wholesalers has kicked in more than $116,000 to various candidates of both parties in 2019, according to VPAP.

Bloomberg’s group, which typically bankrolls TV ads that come late in the campaign, has yet to give any money this year, but both sides expect it to spend big in Virginia.

The NRA made no effort to bus members to Richmond this week for the legislative session, which was called by Gov. Ralph Northam (D) in the wake of the May 31 mass shooting in Virginia Beach in which 12 people were killed at a municipal building.

Instead, the organization held closed-door sessions around the state, each one hosted by a Republican lawmaker, and provided information sheets and talking points about the ineffectiveness of gun-restriction proposals. Hundreds of gun owners went to Richmond on their own.

In the speaker’s conference room at the General Assembly session, NRA members were given the chance to sign up for text messages that would keep them updated on when and where committee meetings would take place later that day. The group handed out 14-page talking points to legislators as they headed into session, laying out positions on such topics as assault-weapon bans and ­extreme-risk protective orders, commonly known as “red flag” laws.

“They’re powerful because they can provide votes,” said Harry L. Wilson, a Roanoke College political scientist with expertise in gun control. “Money’s a good thing . . . but that’s never been what’s determined the NRA’s power. It’s always been their ability to turn out votes.”

The day after the session, Wilson said, the NRA was already pressing its case — emailing members that “the fight has just begun.”

The organization has five paid field directors in Virginia, and all were in Richmond on Tuesday, dressed in suits and ties, in keeping with the professional image the NRA tries to project.

“We are glad that our state team communicates directly with the leadership on both sides of the aisle in both House and Senate, and even with the Northam administration,” NRA spokeswoman Catherine Mortensen said via email. “We provide research and comments on a variety of legislative issues to all Virginia legislators to help educate them on our issues.”

Northam’s secretary of public safety, Brian Moran, said it is true that the NRA communicates with the governor’s office. “They come to committees and oppose all of our bills,” he said. “But for this special session, I’m not aware of any communication with their group. . . . All I heard from them was adamant opposition.”

Moran hosted public meetings all around the state in the weeks before the session, working with activist groups to help build support for gun control.

The governor’s office also consulted with outside groups to assemble eight legislative proposals — including bans on automatic weapons and silencers; a return to Virginia’s one-handgun-a-month limit on purchases; a red-flag law; and giving localities the power to enact their own gun restrictions.

Among the groups that worked with Northam and other Democrats to create bills were Moms Demand Action, Everytown, Giffords, Brady, and the Coalition to Stop Gun Violence, Moran said. The gun-control groups also sent squadrons of staffers to Richmond on Tuesday to help organize outdoor rallies and protests.

Most of those groups are Democratic donors. Everytown has the deepest pockets, giving $1.4 million to Northam in his 2017 governor’s race — his fourth-biggest donor behind the Democratic Governors Association’s super PAC, the Virginia League of Conservation Voters and Planned Parenthood, according to VPAP.

Lori Haas, the Virginia director of the Coalition to Stop Gun Violence, has worked particularly closely with the administration, appearing at events with Moran and Northam. She also appeared in Virginia Beach with Democratic state Senate candidate Missy Cotter Smasal, who staged a town hall with members of Moms Demand Action on the same night that her opponent — Republican incumbent William R. DeSteph Jr. — attended a session with the NRA.

“Had Republicans worked with the gun-violence prevention movement, I think some negotiating might have happened over these many years,” said Haas, whose daughter was wounded in the 2007 mass shooting at Virginia Tech.

Haas disputed the idea that the NRA has outsize influence in Virginia. “I don’t believe that Republicans in the General Assembly are doing this only because of the influence of the gun lobby,” she said. The lawmakers do not need persuading because “most of them believe in an extremist version of the Second Amendment,” she said.

In fact, many lawmakers, aides and lobbyists had thought there was a good chance Republicans would come to the session willing to make a deal on at least one measure — a red-flag law. The NRA has said it supports such laws in concept, and the measures have been endorsed by the Trump administration.

Del. Richard C. “Rip” Sullivan Jr. (D-Fairfax), who sponsored the bill, said he had worked with the NRA and another gun rights group, the Virginia Citizens Defense League, to try to address concerns.

But in the end, GOP leaders were unwilling to give ground, according to several people who spoke on the condition of anonymity to discuss the sensitive deliberations. Two factors prevented compromise, these people said: a deep belief that any restrictions erode the Second Amendment and a fear that Northam would amend the bill in unpalatable ways.

“They could have engaged with us on the extreme-risk law,” Moran said. “It will be interesting to see, as we approach November, how . . . inaction by the Republicans will play out in the election.”

Democrats believe gun control is a good issue for them, particularly in crucial suburban districts where they hope to carve away a few more Republican seats to alter the balance of power in the legislature.

Republicans go into the fall hanging on to control with the thinnest of margins: 20 to 19 in the Senate and 51 to 48 in the House, with one vacancy in each chamber.

Suburban Republicans are walking a fine line on the gun issue. In Virginia Beach, after the NRA meeting, DeSteph’s office called a reporter repeatedly to note that he had also met with Moms Demand Action.

Similarly, a spokesman for Cox (Colonial Heights) insisted that the NRA’s use of the speaker’s conference room during the special session did not signify a close working relationship, saying it is a public space available to any group with interests before the legislature. The spokesman declined to provide examples of other groups that have used it.

When Republicans adjourned Tuesday, they sent all the bills to the state Crime Commission for review and deferred any action until Nov. 18 — after this fall’s elections.

Many of the hundreds of gun rights supporters who flocked to Richmond on Tuesday viewed the outcome as a victory — and a sign that the NRA’s organizational troubles have not set back their cause.

“It’s time to take the NRA in a new direction — new blood,” Charles Nesby, 68, a firearms instructor from Arlington, said of the organization’s top leadership. He said he has a “lifetime endowment” membership to the NRA.

Yet he credited emails from the NRA and another gun rights group for inspiring him to drive to Richmond on Tuesday. He stopped by the House speaker’s unadorned conference room to pick up an NRA T-shirt and thank its staffers for helping with the fight in Virginia’s Capitol that day — support that included a pizza lunch in the room when it was all over early that afternoon.

“The internal struggle is no different than any other corporation that has internal struggles, and they will resolve themselves,” he said. “But at the grass-roots level, we are all still on the same page.”