This paper aims to explore Machine Learning-based traffic prediction in 5G networks using the QualNet simulator and the Spatio-Temporal Long Short-Term Memory (STLSTM) model. The study evaluated the performance of the STLSTM model by comparing it with other models such as Long Short-Term Memory (LSTM), Gated Recurrent Unit (GRU), and Convolutional Neural Network (CNN). The evaluation metrics used for the simulation experiments included Packet Delivery Ratio (PDR), throughput, end-to-end delay, and jitter. The results showed that the STLSTM model outperformed the other models in terms of Root Mean Square Error (RMSE), Mean Absolute Error (MAE), and R-squared, and achieved improved accuracy in predicting traffic in 5G networks. The findings of this study can help network operators to effectively manage traffic and optimize network performance.