For 500 years, the Bolivian Andes have been heavily mined. Today, the water that seeps out of them is nasty stuff. It’s tainted red with iron and laden with toxic metals such as cadmium that pollute rivers for hundreds of miles. The water can be so poisonous that, over time, it destroys the livers and kidneys of area residents. In Bolivia, expensive high-tech solutions aren’t an option. So how to clean up the waterways on a shoestring budget? Add llama dung.

That’s what Paul Younger, a hydrogeochemical engineer from Britain’s Newcastle University, and his colleagues have tried as part of a pilot study in La Paz. The cleansing power of the dung comes from the bacteria it harbors.

These bacteria munch on sulfate, plentiful in mine water, turning it into sulfide. The sulfide then reacts with the metals dissolved in the water to become a solid that can be easily filtered out.

Another boon: Believe it or not, the dung makes the water, which can be as acidic as vinegar, drinkable. After traveling through filtration tanks–essentially limestone layered with about 3 feet of llama droppings–the water is no more acidic than normal rainwater.

Results from the pilot study are so encouraging that Younger is now looking for funding to apply the filtration system more broadly.