This paper presents the thermoeconomic analysis and assessment of a municipal wastewater treatment system. Operation of an existing municipal wastewater treatment plant is described in detail and a thermoeconomical methodology based on exergoeconomic relations and the specific exergy costing (SPECO) method is provided to allocate cost flows through subcomponents of the plant. SPECO method is based on a step by step procedure which begins from identification of energy and exergy values of all states defined in the present system through fuel (F) and product (P) approach and ends at the point of establishing related exergy based cost balance equations together with auxiliary equations. The system treats nearly 222,000 m(3) domestic wastewater per day by using the primary and secondary treatment systems. Activated sludge is digested in the anaerobic digestion reactors to produce biogas with a 60% methane content. For each 1 m3 biogas produced in the wastewater treatment plant, 68.26 kg of sludge with the dry matter content of 5.0% is digested. The de-watered digested sludge with the dry matter content of 22% is considered as a waste and used for agricultural land applications, currently. The actual exergetic efficiency of the wastewater treatment plant is determined to be 34% which indicates that 66% of the total exergy input to the plant, mainly by sewage and power consumptions, is destroyed. The exergetic cost rate and the specific unit exergetic cost of the treated wastewater at the exit of the WWTP are found to be 62.05 $/h and 3.804 cent/m(3), respectively. The corresponding costs are 81.90 $/h and 1.907 cent/m(3) for digested sludge at the exit of secondary anaerobic digestion reactor and de-watering unit; and 175.9 $/h and 13.48 cent/m(3) for the biogas produced at the exit of primary and secondary anaerobic digestion reactors, respectively. (C) 2012 Elsevier Ltd. All rights reserved.