The Pb(II) and Ni(II) biosorption of a fungal biomass isolated from mine drainage of metal-processing industries in Balya (Balıkesir province, Turkey) was optimized using a response surface methodology by altering parameters such as pH, initial metal concentration, contact time and biosorbent dosage. This strain was shown to be highly similar to Penicillium sp. Furthermore, zeta potential measurements and Fourier transform infrared spectroscopy were performed to understand the adsorption mechanism. A Box–Behnken design with 29 experiments was used to evaluate the interactions between independent variables. The results showed that the fungal biomass isolated from the metal mine drainage could have a significant environmental impact through the biosorption of Pb(II) and Ni(II) in waters polluted with heavy metals, particularly in the drainage from metal mines. The maximum removal values were 76 and 47 % at pH 4.5 for both Pb(II) and Ni(II), with 123 and 33 mg/L initial metal concentrations, 65 and 89 min contact times and 0.2 and 1.6 g/L biosorbent, respectively.