The 2,4,6-trinitrotoluene (TNT), a nitrogenous pollutant, that is released into the environment by the munitions and military industries, and TNT-contaminated wastewater can lead to serious health problems. The present study employed the artificial neural network modeling for optimizing the TNT removal by the extended aeration activated sludge (EAAS). Chemical oxygen demand (COD) concentration of 500 mg/L, hydraulic retention time (HRT) of 4 and 6 hours, and TNT concentration of 1 to 30 mg/L were employed to obtain the optimal removal efficiency in this research. The kinetic coefficients were calculated to describe the kinetics of TNT removal by EAAS system.The data obtained from TNT removal were optimized by artificial neural network based on the adaptive neuro fuzzy inference system (ANFIS) method and genetic algorithms (GA). The removal efficiency of TNT by EAAS system was reached 84.25% under optimized conditions (10 mg/L TNT concentration and 6 hours). Our findings revealed that the optimization of EAAS system based on the ANFIS could improve TNT removal efficiency. Moreover, in comparison with the previous studies, it can be concluded that the optimized EAAS system has the capacity to remove higher concentration of TNT from wastewaters.