A new state law approves Southampton Town’s plan for paying back its Community Preservation Fund, which the town had used to make in-lieu-of-tax payments to two school districts.

Last year, the state comptroller’s office discovered during an audit that the town had used more than $664,647 from the fund in 2008 and 2009 to compensate the Riverhead and Eastport-South Manor school districts for land taken off tax rolls after it had been acquired for preservation.

Assemb. Fred W. Thiele Jr. (I-Sag Harbor) and State Sen. Kenneth P. LaValle (R-Port Jefferson) sponsored the legislation that was passed and signed into law recently by Gov. Andrew M. Cuomo. It allows the town to pay back the fund by transferring assets from another preservation fund — one funded by developers seeking zoning changes on large projects.

“It was imperative that these funds be restored to be used for the rightful purpose of land preservation. This legislation ensures that will happen,” Thiele said.

The preservation fund uses money generated by a real estate tax.

Southampton Supervisor Anna Throne-Holst said the bill will allow repayment without impacting taxpayers.

“We have already begun to set the corrective action plan in motion, and the governor’s approval now allows us to complete the process accordingly,” she said.