Traditional models for total phosphorus (TP) retrieval from remote-sensing images generally show low accuracy. Additionally, parameter adjustment and selection of parameter combinations of machine learning (ML) models exert significant influences on the regressive prediction effect and model performance. To solve these problems, this research proposed an extreme gradient boosting (XGBoost) model optimized by Bayesian optimization (BO), that is, BO-XGB. The optimal parameters of the model are sought automatically from a small sample size through BO, which shortens the training time. Taking Tiande Lake in Zhengzhou City (Henan Province, China) as the research region of interest, a BO-XGB model for TP retrieval is established based on GF1-WFV satellite data and TP water-quality data. Moreover, the accuracy of the model is compared with those of retrieval models established based on other four ML methods, namely, the XGBoost model, k-nearest neighbors (KNN), multilayer perceptron (MLP) and random forest (RF). Compared with the other four models, the BO-XGB TP retrieval model demonstrates the highest accuracy, with coefficients of determination R2 , root mean square error (RMSE), and mean relative error (MRE) separately of 0.923, 2.15 × 10-3 mg/L, and 1.81%. Finally, GF1-WFV satellite data are adopted to retrieve the spatial distribution of the TP concentration in Tiande Lake. The results show optimizing the XGBoost model using BO can significantly improve retrieval accuracy and the BO-XGB algorithm is more suitable for retrieving the TP mass concentration in Tiande Lake. The findings have implications for the inverse modelling of non-optical water quality parameters such as total nitrogen(TN).