A gun-control nonprofit founded by former Arizona congresswoman Gabby Giffords (D) filed a federal lawsuit against the National Rifle Association on Tuesday, alleging the group orchestrated an illegal, secret donation scheme involving millions of dollars that violated campaign finance laws and benefited then-candidate Donald Trump and other Republicans.

The lawsuit was filed by campaign finance watchdog Campaign Legal Center on behalf of Giffords in the U.S. District Court for the District of Columbia. It accuses the NRA of using a network of shell companies to skirt campaign finance laws and give money to Trump and GOP candidates.

The nonprofit, which is called Giffords, alleges the shell companies affiliated with the NRA illegally coordinated with Republican campaigns to use the same personnel and vendors to run ads for GOP candidates, claiming the vendors were “functionally indistinguishable.” Campaign finance laws state that such a practice is illegal.

The complaint came after a federal judge granted Giffords’s nonprofit the right to sue the NRA when the Federal Election Commission failed to act on previous complaints. It calls for the court to prevent the NRA from “violating the law in future elections” and for the gun rights group to pay a fine to the Treasury Department equal to the alleged total in the donation scheme.

The lawsuit alleges as much as $35 million in “unlawful” and “unreported in-kind campaign contributions” went toward a scheme that goes back as early as 2014, with $25 million allegedly going toward Trump’s 2016 presidential campaign. Republican campaigns for Sen. Josh Hawley (Mo.) and Rep. Matthew M. Rosendale (Mont.) are named as defendants in the lawsuit, and GOP Sens. Thom Tillis (N.C.), Tom Cotton (Ark.), Ron Johnson (Wis.) and former senator Cory Gardner of Colorado are also mentioned.

David Pucino, a senior staff attorney with the Giffords Law Center to Prevent Gun Violence, an organization that works in conjunction with the former legislator’s nonprofit, said in a news release that the lawsuit demonstrates how “the NRA broke the law” by allegedly illegally funneling millions to Trump and Republicans supporting their agenda.

“The NRA has long acted like it is above the law, and it has done so flagrantly in the last several election cycles,” Pucino said. “We are suing the NRA to finally hold them accountable for actions that corrupted politicians and undermined our democracy.”

Taylor Budowich, a spokesman for Trump, did not immediately respond to a request for comment early Wednesday. None of the spokesmen for the GOP lawmakers or candidates cited in the lawsuit immediately responded to requests for comment. The NRA told The Washington Post in a statement that the lawsuit is “as misguided as it is transparent.”

“Another premeditated abuse of the public by our adversaries — who will stop at nothing in their pursuit of their anti-freedom agenda,” the organization said. “Suffice to say, the NRA has full confidence in its political activities and remains eager to set the record straight.”

Tuesday’s lawsuit could force the FEC, a politically deadlocked group whose Democrats have accused Republicans of not enforcing campaign violations, to act against the NRA. An FEC spokesman declined to comment.

The Giffords lawsuit comes as the U.S. Supreme Court is set to hear a significant gun-rights case Wednesday brought by an NRA affiliate in New York. The New York State Rifle and Pistol Association argues that a state law prohibiting people from carrying a concealed gun in public unless they can demonstrate a need to carry the weapon is too restrictive. If the court rules in the NRA affiliate’s favor, the number of people eligible to carry concealed firearms in public could increase drastically.

The NRA is confronting challenges that have undercut the power of the long-feared lobby organization. Last year, New York Attorney General Letitia James (D) filed a sweeping lawsuit accusing the group of violating its nonprofit status as its top leaders allegedly raided the organization’s coffers for personal gain. In May, a federal judge in Dallas rejected the NRA’s push to declare bankruptcy, calling it an attempt to avoid legal scrutiny and citing “lingering issues of secrecy and a lack of transparency.”

Yet its hold on the gun-control debate endures, especially after the NRA announced in the spring that it was launching a $2 million campaign to fight against gun-control measures backed by President Biden and leading Democrats.

Giffords, who retired from Congress after she was shot in the head at point-blank range during a 2011 mass shooting in her district that killed six and injured 13 others, first filed a series of complaints to the FEC in 2018 that targeted the NRA for its alleged secret donation scheme. When the FEC did not act on those complaints, the nonprofit reached out to the Campaign Legal Center and took the commission to court.

On Sept. 30, the U.S. District Court in the District of Columbia issued an order compelling the FEC to act on Giffords’s previous complaints within 30 days. The FEC did not act in that time period, and the court ruled Monday that the nonprofit could sue the NRA itself.

“The FEC had the chance to do its job by taking action against the NRA for this massive coordination scheme,” Molly Danahy, senior legal counsel for litigation at Campaign Legal Center, said in a news release, “but as usual, the FEC failed to enforce the law.”

The lawsuit claims that the vendors used by campaigns, which had different names when working for campaigns, were the same group of people associated with the NRA.

“They are led by the same people, located at the same address, and have no internal separation or firewall between the staff who work for each entity,” the lawsuit said. “Indeed, the same staff performed work for both the NRA Affiliates and the candidates’ campaigns during the same election cycle.”

GOP Senate campaigns in 2014, 2016 and 2018 benefited from the alleged scheme, according to the lawsuit. By coordinating an advertising spending strategy for federal candidates through a common vendor, the lawsuit claims, tens of millions of dollars were given as campaign contributions “in excess of the contribution limits, in violation of the source restrictions, and without the disclosure required under federal law.”

“This includes up to $25 million in coordinated, illegal contributions to the Trump campaign in 2016,” the lawsuit said.

Ellen Weintraub, the sitting Democratic commissioner for the FEC, told The Post that Congress built a loophole that allowed Giffords’s group to take the NRA to court following the deadlocked commission’s inaction.

“It’s unusual for it to work out this way, but I’m glad that the drafters of the Federal Election Campaign Act provided us a couple different ways to getting the law enforced,” she said. “A lawsuit of this kind will allow the court to take a fresh look at the complaint.”

Tom Hamburger contributed to this report.