In Ecuador, large gold deposits were discovered in the areas of Nambija and Ponce Enríquez, but they contain metal sulfides that, when exposed to the action of air and water, intervene in a series of physical, chemical and biological phenomena. The oxidation of sulfides to sulfates occurs by the catalytic action of bacteria, in addition to the production of sulfuric acid that dissolves heavy metals such as iron, copper and zinc; a process known as bioleaching. These solutions, with a high level of acidity, are carried away by water currents or runoff, becoming a great contaminant of water and soil of the surrounding sector. Acid mine drains are one of the main problems of environmental pollution; the mining deposits are located in areas of great biodiversity. In these areas there are births of water used for human consumption, agriculture and mining work; the mismanagement of tailings, tailings and sands that are discharged into rivers and streams generate serious environmental damage. The objective of the work is to use selective precipitation to recover iron, copper and zinc from acid solutions produced by bioleaching during the extraction of precious metals at the laboratory level and from acid drainage of natural mine, to comply with environmental regulations regarding the discharge of effluents and reduce the effect of environmental pollution produced by acid mine drains. This investigation presents the conditions for a successful individual recovery of the main base metals contained in a bioleaching solution with high copper, zinc, and iron concentrations by pH-based selective precipitation. Tests were made with standard solutions of known concentrations of copper, iron, lead, and zinc and by titration the concentrations were checked, which allowed to validate the volumetric titration method. The selective precipitation of heavy metals was carried out in three phases using real acid main drainage and bioleaching solutions generated at the laboratory. The first phase in a pH range of 2 to 4 to recover iron; the second phase in a pH range of 4 to 6 to recover copper; and the third phase in a pH range of 6 to 10 to recover zinc. The selective precipitation allowed the heavy metals to be completely removed from the solution or to achieve concentrations below the maximum allowable limit to be discharged to a body of water or public sewer. Validation of SOLBIO 2 and Orenas bioleaching solutions was performed.