The optimization of the pre-treatment by sulfuric acid of sugarcane bagasse is crucial for a cost-effective production of second-generation bioethanol. In this study, a multi-objective optimization was applied, using a desirability function, to optimize the dilute sulfuric acid pre-treatment of Moroccan sugarcane bagasse. Based on a central composite design, glucose, xylose, furfural, and HMF concentrations were determined as a function of sulfuric acid concentration (0.75-1.5% v/v), temperature (80-130 degrees C), and time (40-120 min). For each investigated output, polynomial models of second order were developed and tested statistically, by following the response surfaces methodology. In addition, the sensitivity of these models has been tested by investigating the variation of products using an extended range of time. The developed models were coupled to a desirability function to maximize glucose and xylose, and minimize furfural and HMF simultaneously. The obtained optimal conditions were 76.12 min of time, 130 degrees C of temperature, and 0.75 (%, v/v) of sulfuric acid concentration. These conditions allow to produce 48.16% of xylose, 16.45% of glucose, 3.41% of furfural, and 2.54% of HMF, with 92% of desirability.