Sewage sludge is a by-product generated from municipal wastewater treatment (WWT) processes. This study examines the conversion of sludge via energy recovery from gasification/combustion for thermal treatment of dewatered sludge. The present analysis is based on a chemical equilibrium model of thermal conversion of previously dewatered sludge with moisture content of 60–80%. Prior to combustion/gasification, sludge is dried to a moisture content of 25–55% by two processes: (1) heat recovered from syngas/flue gas cooling and (2) heat recovered from syngas combustion. The electricity recovered from the combined heat and power process can be reused in syngas cleaning and in the WWT plant. Gas temperature, total heat and electricity recoverable are evaluated using the model. Results show that generation of electricity from dewatered sludge with low moisture content (≤ 70%) is feasible within a self-sufficient sludge treatment process. Optimal conditions for gasification correspond to an equivalence ratio of 2.3 and dried sludge moisture content of 25%. Net electricity generated from syngas combustion can account for 0.071 kWh/m3 of wastewater treated, which is up to 25.4–28.4% of the WWT plant's total energy consumption.