State Treasurer Dale Folwell said Friday he “will pursue all avenues of appeal” after Durham Superior Court Judge James Hardin ruled against the state in enforcing regulations against massive pension spiking by a select group of state employees.

“My administration inherited this case and is disappointed with the court’s ruling,” Folwell said in a news release. The case involves the treasurer’s administration of what is known as the contribution-based benefit cap for the North Carolina retirement systems. Former treasurer Janet Cowell issued the first assessments, which were authorized by the General Assembly.

“The legislature’s intent was to protect the taxpayers of this state from pension spiking,” Folwell said. “This is not about a custodian who becomes a supervisor the last few years of their career. The people who benefit from spiking are people in power, or who know people in power, not the average, hard-working state employee.”

Hardin ruled against the Teachers’ and State Employees’ Retirement System, which had ordered four local boards of education to make extra pension-system payments to cover spiking the retirement pensions of their school superintendents.

The judge said those payments were invalid because TSERS, under former Treasurer Janet Cowell, had not followed policies under the state’s Administrative Procedure Act.

Pension spiking occurs when an employer hands out a large pay raise late in an employee’s career that boosts the annual pension the employee will receive. The contribution-based benefit cap was put in place in 2015 to eliminate those sweetheart deals.

Johnston, Wilkes, Union, and Cabarrus counties challenged the cap and payback requirements in 2016 because they did not want to be saddled with the costs of their pension spiking activities.

The county assessments Hardin overturned ranged from $208,000 to $495,000, including one superintendent, retired at age 50, who spiked his retirement by almost $500,000.

The contribution-based benefit cap law applies to retirements with an average final salary greater than $100,000. It represents less than 0.75 percent of all retirees. Before the law passed, the retirement systems absorbed the extra cost of underfunded retirements. These liabilities, in turn, had to be covered by employers and employees through taxes and other fees.

As of May 3, 2017, 101 retirements have triggered the cap law. TSERS has received more than $6 million in additional contributions.