Prediction of groundwater quality is an essential step for sustainable utilization of water resources. Most of the related research in the study area focuses on water distribution and rational utilization of resources but lacks results on groundwater quality prediction. Therefore, this paper introduces a prediction model of groundwater quality based on a long short-term memory (LSTM) neural network. Based on groundwater monitoring data from October 2000 to October 2014, five indicators were screened as research objects: TDS, fluoride, nitrate, phosphate, and metasilicate. Considering the seasonality of water quality time series data, the LSTM neural network model was used to predict the groundwater index concentrations in the dry and rainy periods. The results suggest the model has high accuracy and can be used to predict groundwater quality. The mean absolute errors (MAEs) of these parameters are, respectively, 0.21, 0.20, 0.17, 0.17, and 0.20. The root mean square errors (RMSEs) are 0.31, 0.29, 0.28, 0.27, and 0.31, respectively. People can be given early warnings and take measures according to the forecast situation. It provides a reference for groundwater management and sustainable utilization in the study area in the future and also provides a new idea for coastal cities with similar hydrogeological conditions.