Ending a month-long tug-of-war over how much more to invest in Memphis schools, Shelby County commissioners on Wednesday approved a budget that nearly fills the $35 million budget gap for Shelby County Schools.

The commission approved an additional $22 million toward the deficit facing Tennessee’s largest school district’s just two days before its new fiscal year begins.

The funding should prevent the school system from having to cut proposed increases for teacher salaries and curtail programs such as the Innovation Zone and CLUE for gifted students — all on the table if the county had stuck with its initial proposed increase of $8.7 million for education across the county, according to Superintendent Dorsey Hopson.

About $12 million of the extra money for Shelby County Schools will come from a tax rule change that previously barred county school systems from benefitting from surplus revenue collections.

The remaining $3.5 million will come from sources that include capping county retiree death benefits at $20,000 and increased revenue projections for the wheel tax.

The allocation to Shelby County Schools leaves up to $6.5 million for the district to fund through its savings and other cuts.

The school board will meet Thursday to finalize the district’s budget.

Wednesday’s vote ends a battle between county Mayor Mark Luttrell’s administration and commissioners, most of whom were open to significantly increasing local education funding for Shelby County Schools and the county’s six suburban school systems. Luttrell’s proposed budget had sought to hold the line amid numerous spending requests and out of concern that this year’s budget will set the baseline for education spending in future years under a state requirement known as maintenance of effort.

The increase for 2016-17 stands in stark contrast to last year, when Hopson asked commissioners for an additional $14 million to help bridge the district’s budget gap. The county funded about half of that, forcing the district to pull $36 million from its savings to stave off further cuts.

This year, the district launched an aggressive campaign to build community support for more money.