BOISE - A bill now on its way to the governor's desk is being hailed as a win for county taxpayers.

Legislation raising the amount the state pays county jails for prisoners passed overwhelmingly in the Senate on Wednesday.

KTVB recently investigated the issue of state prisoners filling up county jail beds. Many sheriffs claim the cost burden is going on the backs of county taxpayers and are calling on the state to get their inmates out of jails.

MORE: 7 Investigates: Criminal justice reform being blamed for jail overcrowding

House Bill 533 addresses that issue. It passed in the Idaho House of Representatives a couple weeks ago with 64 votes in favor, two against, and three absent. On Wednesday, the bill made it through the Idaho Senate with 30 votes in favor and five against.

Currently, the Idaho Department of Correction (IDOC) pays counties $45 per day to house a state inmate. This bill raises that to $55 a day for the first seven days an inmate is in the county's custody and $75 a day per inmate beyond that.

The cost to house inmates varies across counties, with the average county cost of housing state prisoners in county facilities being more than $81 a day. In Canyon County, for example, it costs around $80 a day to house an inmate and in Ada County it costs about $96.

The Idaho Sheriffs Association says county taxpayers are left footing the rest of the bill.

"It's a state cost and should be paid by the state, not by local county taxpayers," Ada County Sheriff Steve Bartlett said. "Hopefully this will give the state some incentive to really look at what their budget looks like and figure out a way to move those inmates out of county jails earlier than seven days to save some costs as well."

According to the bill's statement of purpose, the rate the state pays counties has only increased $10 over the last 20 years. A number of state inmates end up staying for weeks in county jails, so this could get expensive for IDOC.

The Spokesman-Review reports this change could cost the state anywhere from $3 million to $11 million next year. The article also cites legislators in opposition who say this bill goes too far or doesn't provide flexibility and is "something we could do better on".

Many legislators and sheriffs continue to point to one solution that's been talked about for years: building a new prison.

Again, this bill is now heading to Gov. Butch Otter's desk.