Phosphorus is a nonrenewable material with a finite supply on Earth; however, due to the rapid growth of the manufacturing industry, phosphorus contamination has become a global concern. Therefore, this study highlights the remarkable potential of ranunculus-like MgO (MO4–MO6) as superior adsorbents for phosphate removal and recovery. Furthermore, MO6 stands out with an impressive adsorption capacity of 596.88 mg/g and a high efficacy across a wide pH range (2–10) under varying coexisting ion concentrations. MO6 outperforms the top current adsorbents for phosphate removal. The process follows Pseudo-second-order and Langmuir models, indicating chemical interactions between the phosphate species and homogeneous MO6 monolayer. MO6 maintains 80 % removal and 96 % recovery after five cycles and adheres to the WHO and EUWFD regulations for residual elements in water. FT-IR and XPS analyses further reveal the underlying mechanisms, including ion exchange, electrostatic, and acid-base interactions. Ten machine learning (ML) models were applied to simultaneously predict multi-criteria (sorption capacity, removal efficiency, final pH, and Mg leakage) affected by 15 diverse environmental conditions. Traditional ML models and deep neural networks have poor accuracy, particularly for removal efficiency. However, a breakthrough was achieved by the developed deep belief network (DBN) with unparalleled performance (MAE = 1.3289, RMSE = 5.2552, R2 = 0.9926) across all output features, surpassing all current studies using thousands of data points for only one output factor. These captivating MO6 and DBN models also have immense potential for effectively applying in the real water test with error < 5 %, opening immense horizons for transformative methods, particularly in phosphate removal and recovery.