Faced with a $1 million premium for upgrades to its wastewater treatment plant, the citizens of a Montana town found a money-saving solution in an unexpected place: a local brewery.

Three years ago, the town of Havre, MT faced a problem: Despite a previous, costly update to its wastewater treatment plant, the town’s water still had issues with phosphorus and nitrogen levels, which can cause dangerous algae blooms in rivers and lakes. A further upgrade to meet new Environmental Protection Agency (EPA) standards was estimated to cost $1 million.

Before paying up, Havre wastewater superintendent Drue Newfield approached Michael Garrity, the owner of Triple Dog Brewing, with an idea: What if Triple Dog donated its spent grains to help normalize the water’s phosphorus and nitrogen levels?

Spent grains, which remain after the brewing process, can account for up to 85 percent of a brewery’s annual byproduct. While they are no longer useful for making beer, they still contain nutrients that can feed naturally-occurring chemical-fighting bacteria.

Newfield and Garrity spent two years fine-tuning their method. Now, every morning, workers at the Havre facility shovel 16 gallons of a spent barley slurry, gathered from Triple Dog and two other local breweries, into the water as it heads to the treatment facility.

The results have been overwhelmingly positive. Not only has the innovation saved Havre taxpayers an estimated $16,000 annually in chemical costs, it has removed the need for the costly upgrade to their facility altogether, and earned the town praise from the EPA.

Now, other towns in Montana are trying their hand at using beer waste to help clean their water. Given the rapid growth in Montana’s craft beer industry, there’s ample opportunity for collaboration.