This study analyses the environmental and economic benefits of integrating renewable energy sources (RES), biogas and solar energy into urban wastewater treatment plants (WWTPs). The energy intensity (kWh/m(3)) of the selected 456 WWTPs in Turkey was evaluated according to type and treatment process. The energy intensity of primary WWTPs (0.066-0.335 kWh/m(3)) is lower than that of secondary (0.075-1.361 kWh/m(3)) and advanced WWTPs (0.147-0.988 kWh/m(3)). RES integration is investigated using energy system optimization software for a sample of 25 WWTPs. Six scenarios were developed based on different CO2 emission penalties (0 and 16 USD/ton) and prices for selling electricity to the grid (0.000, 0.050, and 0.133 USD/kWh) to demonstrate the impact of market-based instruments. RES integration is cost-effective for secondary and advanced WWTPs with a flow capacity above 1 million m(3)/y. Market-based instruments are found to significantly influence the decision to integrate, generate and use renewable electricity at WWTPs. The RES integration can meet up to 88% of the annual energy demand of the WWTPs at an electricity selling price of 0.133 USD/kWh. When no market-based instruments are implemented, RES generation can reach up to 23% of the WWTPs' annual energy demand while reducing CO2 emissions by 15%. (C) 2022 Elsevier Ltd. All rights reserved.