Traditionally, climate conditions have been one of the influential factors in population growth in worldwide. Hence, predicting these conditions can be an important step to improve life conditions in worldwide. In this study, application of genetic algorithm (GA) and particle swarm algorithm (PSO) were considered as alternatives to available algorithms for training artificial neural network (ANN) and adaptive neuro-fuzzy inference system (ANFIS) in order to predict air temperature. Therefore, monthly minimum, average and maximum air temperatures of Tehran-Iran station at 64-years (1951-2014) were selected as predicted time-series. First, the most appropriate inputs were selected for the models using sensitivity analysis. After that, long-term air temperatures (1 month, 1-, 2-and 3-year ahead) were modeled. Results showed that: 1) the given algorithms had acceptable results in improving the models' performance in forecasting minimum, mean and maximum air temperatures. Also, they could improve the performance of ANN and ANFIS in most of the prediction intervals, 2) ANFIS-GA was selected as the most suitable model so that its average determination coefficient (R 2 ), root mean square errors (RMSE) and mean absolute errors (MAE) were 0.88, 1.41 and 2.52, respectively, 3) the sensitivity analysis provided suitable results in selecting the most appropriate model inputs for forecasting the minimum, mean and maximum air temperatures in different intervals.