SolarCity has agreed to pay $29.5 million to settle long-running claims it overcharged the federal government for rebates on solar systems installed between 2009 and 2013.

The settlement ends a five-year battle between federal regulators and the solar system installer, now a subsidiary of Tesla, over payments from the American Recovery and Reinvestment Act. The program was part of President Barack Obama’s stimulus package to boost the economy following the 2008 financial crisis.

“This program expired, but this settlement demonstrates that the government will still hold accountable those who sought to take improper advantage of government programs at the expense of American taxpayers,” acting Assistant Attorney General Chad Readler said in a statement announcing the settlement on Friday.

A spokesman for SolarCity said the company accurately valued its projects.

“SolarCity took its responsibilities under the program very seriously,” the spokesman said. “Far from trying to overstate the value of those projects, it went to great lengths to determine accurate values.”

Both sides also agreed to drop further claims over the projects. The program ended in December 2016, although other rebates remain available.

The renewable energy section of the reinvestment act was intended to subsidize the clean energy industry, making projects cheaper for consumers and spreading the technology. As solar systems grew more popular, costs declined.

SolarCity installed renewable systems on homes and businesses, promising lower electrical bills over a long-term lease. It reaped gains from government subsidies and reselling excess power to utilities.

SolarCity filed claims on 29,000 eligible solar projects it valued at $1.8 billion, according to the company. Federal regulators valued the eligible projects worth $1.7 billion, and awarded SolarCity $510 million for the portfolio.

In 2012, regulators re-opened the claims and conducted further investigation. Prosecutors claimed SolarCity and related investment funds overstated the costs of its projects and took in inflated grant payments.

SolarCity said it consulted regulators and independent appraisers to arrive at a valuation for the projects. The company sued the government to keep all of its cash grants.

Tesla bought SolarCity in November 2016, after the disputed claims had been filed. CEO Elon Musk, also chairman of SolarCity at the time of the acquisition, said the combined companies would offer a better package of renewable energy projects to consumers.

The company recently began selling solar roofs, combining the aesthetics of traditional tiles and shingles with power-generating solar cells.