Groundwater is a crucial source of water supply in drought conditions, and an auxiliary water source in wet seasons. Due to its increasing importance in view of climate change, predicting groundwater level (GWL) needs to be improved to enhance management. We used adaptive neuro-fuzzy inference systems (ANFIS) to predict the GWL of the Urmia aquifer in northwestern Iran under various input scenarios using precipitation, temperature, groundwater withdrawal, GWL during the previous month, and river flow. In total, 11 input patterns from various combinations of variables were developed. About 70% of the data were used to train the models, while the rest were used for validation. In a second step, several metaheuristic algorithms, such as genetic algorithm (GA), particle swarm optimization (PSO), ant colony optimization for continuous domains (ACOR), and differential evolution (DE) were used to improve the model and, consequently, prediction performance. The results showed that (i) RMSE, MAPE, and NSE of 0.51 m, 0.00037 m, and 0.86, respectively, were obtained for the ANFIS model using all input variables, indicating a rather poor performance, (ii) metaheuristic algorithms were able to optimize the parameters of the ANFIS model in predicting GWL, (iii) the input pattern that included all input variables resulted in the most appropriate performance with RMSE, MAPE, and NSE of 0.28 m, 0.00019 m, and 0.97, respectively, using the ANIFS-ACOR hybrid model, (iv) results of Taylor’s diagram (CC = 0.98, STD = 0.2, and RMSD = 0.30), as well as the scatterplot (R2 = 0.97), showed that best prediction was achieved by ANFIS-ACOR, and (v) temperature and evaporation exerted stronger influence on GWL prediction than groundwater withdrawal and precipitation. The findings of this study reveal that metaheuristic algorithms can significantly improve the performance of the ANFIS model in predicting GWL.