(Bloomberg) -- The National Rifle Association racked up $22 million in legal costs in the first five months of 2021, on pace to surpass the record $40 million spent for all of last year, even as efforts to match its 2020 revenue faltered, internal documents indicate.

Legal costs were the nonprofit’s largest single expense after membership activities in the five months through May, when a judge rejected the gun-rights group’s bid to reorganize through bankruptcy, documents obtained by Bloomberg show. While there’s no guarantee legal expenses will continue to rise at the same rate, they’ve accelerated since 2018, according to tax filings. That’s when staff members began expressing concerns about practices that have since led to costly disputes.

The recent financial data illustrate the challenges the NRA faces after years when revenue has remained below its peak, though the group said it added about 350,000 new members in 2021, and has cut operating costs. Tax records show revenue fell 21% from 2016 to 2019, while unaudited results for last year and the NRA’s below-budget performance so far in 2021 indicate further declines.

“The NRA continues to manage its finances in the best interests of its members,” Andrew Arulanandam, the NRA’s managing director of public affairs, said in a statement. “Importantly, the NRA emerged from the pandemic better situated than most nonprofits and advocacy groups.”

A sharp drop in spending in 2020 helped the organization reverse four years of losses, documents show. Total revenue for the first five months of 2021 was $109 million, compared to expenditures of $101.3 million, according to the documents, which include unaudited results.

“Except for legal fees, spending has been down pretty notably” the past few years, says Brain Mittendorf, an Ohio State accounting professor who follows the NRA. “It hits at the new normal that they’re going to be a smaller organization than they were in previous years. The question is whether they’ll lose people because of it.”

‘Well-Positioned’

The NRA says it is growing, not shrinking.

“Membership, donations and grassroots support are surging at the NRA,” Arulanandam said. “The organization has emerged from the pandemic well-positioned to advance its programming, serve its members, and defend the Second Amendment.”

The NRA was involved in a major legal fight this year. The gun-rights organization filed for bankruptcy protection in January as part of a complex bid to move to Texas from New York, where it is chartered. After a two-week trial, a federal judge in May rejected the NRA’s bankruptcy case for “not having been filed in good faith.” The judge said it was filed to “gain an unfair litigation advantage” and “avoid a state regulatory scheme.”

Read More: NRA’s Failed Gamble in Texas Boosts Chances of Its DemiseThat leaves the NRA, which describes itself as the nation’s oldest civil rights organization, to defend against a lawsuit in New York filed last August by state Attorney General Letitia James. She has accused the group and top executives of self-dealing and mismanagement and called for it to be dissolved.

The NRA and its leaders have denied wrongdoing.

“James’s persecution of the NRA is an attempt to retaliate against the NRA for its right to free speech regarding the constitutionally protected right to bear arms,” William A. Brewer III, counsel to the NRA, said in a statement.

Calls for Ouster

The organization has faced fierce criticism from members of its own board, one of whom testified that the federal bankruptcy court should appoint an examiner to look into James’s allegations. Even pro-Second Amendment media, including Ammo Land and Gun Talk, have drawn attention to NRA critics and calls for the ouster of Chief Executive Officer Wayne LaPierre.

“Wayne LaPierre continues to enjoy the support of NRA leadership and millions of members,” NRA President Carolyn Meadows said in a statement. “There is no greater defender of the Second Amendment and our nation’s constitutional freedoms.”The NRA’s legal troubles deepened in 2019 when news reports indicated that senior executives had used the nonprofit’s assets to fund lavish personal lifestyles. Some of the money has been repaid to the group, which says it has improved its internal controls.

As allegations spilled out in public, revenue from members, the largest source of income, plunged by a third to $113 million in 2019, from $170 million a year earlier, Internal Revenue Service filings show.

According to the internal documents, total revenue, including income from grants, affinity programs and other operations, fell from $295.3 million in 2019 to $285.4 million in 2020. Through the end of May this year, the total was about $109 million, which leaves the NRA about $5.6 million behind its goal of matching the 2020 figure, the records show.

In 2016, revenue was $367 million, and that year the NRA was the largest contributor to Donald Trump’s successful run for president. As the NRA’s legal troubles have mounted, the group hasn’t been as big a spender on candidates, according to Anna Massoglia, an investigative researcher with OpenSecrets, formerly the Center for Responsive Politics.

“We did see the NRA arrive late in the 2020 election cycle,” Massoglia said. “It will be very interesting to see how much it spends in 2022.”

Read More: NRA’s Permitless Gun Laws Sweep Red States Despite Group’s Woes

Among the areas where the NRA’s proposed budget has lower receipts this year compared to 2019 are: grants and general endowments, general operations and royalties, and affinity and other programs, the documents show. The Institute for Legislative Action, the NRA’s political arm, has budgeted a modest revenue decline this year to $28.5 million.

Everytown for Gun Safety, which advocates for universal background checks and gun-safety measures, is backed by Michael Bloomberg, founder and majority owner of Bloomberg News parent company Bloomberg LP.

©2021 Bloomberg L.P.