Background: Sugarcane is an attractive feedstock for ethanol production, especially if the lignocellulosic fraction can also be treated in second generation (2G) ethanol plants. However, the profitability of 2G ethanol is affected by the processing conditions, operating costs and market prices. This study focuses on the minimum ethanol selling price (MESP) and maximum profitability of ethanol production in an integrated first and second generation (1G + 2G) sugarcane-to-ethanol plant. The feedstock used was sugarcane juice, bagasse and leaves. The lignocellulosic fraction was hydrolysed with enzymes. Yields were assumed to be 95\% of the theoretical for each of the critical steps in the process (steam pretreatment, enzymatic hydrolysis (EH), fermentation, solid/liquid separation, anaerobic digestion) in order to obtain the best conditions possible for ethanol production, to assess the lowest production costs. Techno-economic analysis was performed for various combinations of process options (for example use of pentoses, addition of leaves), EH conditions (water-insoluble solids (WIS) and residence time), operating cost (enzymes) and market factors (wholesale prices of electricity and ethanol, cost of the feedstock). Results: The greatest reduction in 2G MESP was achieved when using the pentoses for the production of ethanol rather than biogas. This was followed, in decreasing order, by higher enzymatic hydrolysis efficiency (EHE), by increasing the WIS to 30\% and by a short residence time (48 hours) in the EH. The addition of leaves was found to have a slightly negative impact on 1G + 2G MESP, but the effect on 2G MESP was negligible. Sugarcane price significantly affected 1G + 2G MESP, while the price of leaves had a much lower impact. Net present value (NPV) analysis of the most interesting case showed that integrated 1G + 2G ethanol production including leaves could be more profitable than 1G ethanol, despite the fact that the MESP was higher than in 1G ethanol production. Conclusions: A combined 1G + 2G ethanol plant could potentially outperform a 1G plant in terms of NPV, depending on market wholesale prices of ethanol and electricity. Therefore, although it is more expensive than 1G ethanol production, 2G ethanol production can make the integrated 1G + 2G process more profitable.