Hydrogen is one of the most promising alternatives as a new energy carrier. The abundance, ease of production from water, the almost unique use and the inherent environmental benefits of hydrogen are its distinguished features comparing to other energy resources. On the other hand, biogas production has a high economic advantage due to the low cost of production, availability of raw materials and various forms of consumption. The second generation of biomass such as agricultural wastes has been recognized as a renewable resource for biofuels production. In this study, production of biohydrogen and biogas from bagasse (sugar production plant waste) has been studied. An organic solvent pretreatment with ethanol was used for bagasse preparation as feedstock and Enterobacter aerogenes was used as facultative anaerobic bacteria. The design expert software was applied to design the organic solvent pretreatment test. The surface response method and design of the central composition test were selected in this design. The recovered mass of total solid and recovered lignin were chosen as the objective functions of this design. Three considered parameters in organic solvent pretreatment including temperature (140-180 ° C), ethanol concentration (50-80% vol) and time (30-90 min). The best fitted model was obtained from laboratory data using ANOVA. Operating conditions including temperature of 160 ° C, ethanol concentration 65% and time 90 min were selected as the optimal pretreating condition. In this case, the production of hydrogen was obtained equal to 59 ml of hydrogen per gram of bagasse. The structure of bagasse tissue was then investigated using FTIR, XRD and scanning electron microscopy. By increasing the ethanol concentration, the crystallinity index was increased; however the enzyme access level and the pretreateded bagasse porosity were improved at high pre-treating intensity. Increasing the pretreartment intensity from 2.65 to 4.31 resulted in decrease of recovered solid mass from 75 to 46%. Ethanol concentration in pretreatment of organic solvent had an important impact on the intensity of chemical activity of water. The highest degradation rate was observed in ethanol concentration 50%. The negative effect of pretreatment on biogas production rate was observed in some of the samples due to the considerable loss of hemicellulose during pretreatment. Finally, the production of biogas from the pretreated bagasse was investigated. The highest amount of biogas production (300 ml/g volatile solid) was achieved in the pretreating operating conditions of 50% ethanol concentration, 180 ° C and 90 min.