The co-treatment of acidic water (AW) and urban wastewater (UWW) is a technique that allows mitigating the negative impact of AW on natural aquatic environments, which represents one of the major environmental problems globally. The aim of this research was to determine the optimal conditions through the response surface methodology (RSM) with a central composite design (CCD) for the co-treatment of AW from the Quiulacocha lagoon in Pasco and UWW from a municipality in Lima, Peru, having as factors the molar ratio of total iron (FeT) and total phosphorus (PT), time (min) and stirring speed (rpm). Data processing was performed using the Design-Expert 11 software, and analysis of variance (ANOVA) with a confidence interval of 95% (α = 0.05) was used. The statistical models obtained showed high determination coefficients (R²), higher than 92% for pH, conductivity and FeT removal. While the removal of COD, PT and obtained a value of R²>0.80, as well as evidenced compliance with the level of significance P value > 0.05. The optimal conditions determined by the statistical model were given at a FeT /PT molar ratio (33:1), a stirring time of 5 min and a speed of 255 rpm. In these conditions, the COD was reduced by 71.78%, FeT by 99.48%, and PT by 84.29% with a residual concentration of 1.3 mg/L; the pH obtained a value of 5.7 and the turbidity 56 NTU. Better efficiency of the co-treatment for the reduction of pollutants in the AW of the Quiulacocha lagoon is evidenced, applying an experimental design to optimize the operating conditions, taking into account that the molar ratio is a significant factor and that optimizing it would allow the co-treatment to be replicated. Co-treatment is a sustainable and promising alternative for the treatment of AW and UWW, since it does not require the use of chemical agents to treat water. However, post-treatments would still be required to comply with certain regulations or to reuse the treated water on a larger scale.