Advanced in-situ reagent generation provides an affordable, non-hazardous, energy efficient and environmentally sustainable solution to remove a wide range of heavy metal and inorganic contaminants.