When you buy tires or pay to have your garbage hauled off, you also pay state fees that are supposed to help clean up tire dumps, old landfills and other sites.

For years, however, state budget writers have diverted tens of millions of dollars from those special funds to fill holes elsewhere in the budget.

Next year they may have to stop the raids. A clever political maneuver on the final day of this year’s legislative session will force lawmakers to spend the money on what it’s intended for — or cut the fees.

Thirteen minutes before the end of the 2013 session, the Senate gave final approval to House Bill 276, which renewed landfill fees that are supposed to be deposited in the state’s Hazardous Waste Trust Fund.

The House amended the bill on the final day to mandate that those fees, along with the fee paid by automobile tire buyers, be used for their intended purposes. Starting next year, if the money gets diverted as it has in the past, the fees will be reduced accordingly.

It is an issue because combined, the tire and landfill fees are projected to bring in about $16 million this year — money the state can’t afford to lose.

The Senate vote came at 11:47 p.m. March 28, just before the Legislature’s deadline to finish work for the year. Sen. Rick Jeffares, R-McDonough, gave an eight-second explanation of the bill and amendment. The Senate then approved the measure 51-1.

The bill’s passage was a major victory for environmentalists and county officials who have long complained that lawmakers divert money meant for hazardous-waste cleanup. They estimate that $130 million has been diverted in the past decade.

“The money wasn’t there when we tried to get some,” said Tommy Stalnaker, chairman of the Houston County Commission. “If you are going to have a dedicated funding source and you are not going to use it for that purpose, let’s just stop collecting it.”

Georgians have complained for years about the state’s penchant for taking fees meant for one thing — from landfill cleanup to driver education — and using it for another.

Lawmakers, chief among them budget-writers like Senate Appropriations Chairman Jack Hill, R-Reidsville, have argued that they need the flexibility — if necessary — to fill holes in a state budget long on needs but short on funds.

In the early 1990s, lawmakers created two new pools of money, the Solid Waste and Hazardous Waste trust funds, to pay to clean up hazardous waste sites, update unlined landfills, clean up scrap tire dumps, improve solid waste collection and recycling and eliminate open dumps along roads and streams.

Much of the money for the hazardous waste fund comes from landfill fees passed on to Georgians when they pay for garbage pickup. The solid waste program is funded by the $1 per tire charge Georgians pay when they buy new tires.

Combined, by the end of this fiscal year, the two programs will have collected more than $200 million since 2004. But only about $80 million of that has actually gone to those trust funds, according to the Association County Commissioners of Georgia. The rest has gone elsewhere to other things — schools, prisons, business regulation, health care, local projects — in the state budget.

Meanwhile, Todd Edwards, a lobbyist for the association, said counties are paying to clean up tire dumps and landfill sites.

“We have to retax local taxpayers for something they thought they’d paid for,” he said. “We have landfills subsidizing the general fund when we could be using the money to clean up those sites.”

Jeffares, one of Deal’s floor leaders, carried the bill in the Senate. He said he realized the amendment reducing the fees had been attached but ultimately decided the bill was too important to block.

“We couldn’t let that bill not pass — we need the money,” said Jeffares.

“I would love to see all these fees go to where they’re supposed to, but we’re also trying to balance this budget,” Jeffares said. “The economy’s been really tough.”

Hill, who has been wary of moves to tie lawmakers’ hands on spending the fees, said he can’t remember whether he knew about the amendment before he voted for HB 276. He said he didn’t “have any particular qualms” about the measure but argued that the state has always funded cleanup efforts requested by counties.

But Stalnaker, the Houston County commission chairman, said when his county applied for money to help deal with landfill gas in his county, the money wasn’t available.

Rep. Jay Powell, R-Camilla, who has been pushing fee legislation for three years, said the amendment maneuver “worked out well and now we will get a chance to see if that mechanism works…and doesn’t kill the state’s budget.”

Powell said he wants more transparency in the system.

“Say ‘this is a tax, and we may use it for something else,’” Powell said. “Just be honest with the voters, instead of doing some sort of bait and switch.”

Deal must still decide whether to sign the legislation. But without it, the hazardous waste fees sunset July 1, and he has already included the money in the upcoming year’s budget. The governor’s staff is just starting the process of reviewing the hundreds of bills passed during the 2013 session.

Some officials don’t expect the fees to ever be reduced. Instead, they said, the money would be spent cleaning up tire or hazardous waste dumps or fixing old landfills. And supporters of HB 276 said they will be watching during the 2014 session to make sure the new law isn’t reversed.

House Bill 276 wasn’t the only victory for those opposing fee diversion. Just after midnight and seconds before the final gavel fell on the session, the Senate also gave final passage to a bill reducing the extra penalties tacked on to some traffic violations. The money from the add-ons is supposed to fund driver education courses statewide, but it has long been diverted to other things.