Soil temperature is a critical factor in soil science, hydrology, agriculture, water resources engineering, geotechnical engineering, geo-environmental engineering, meteorology, and climatology. Reliable prediction of subsurface, near-surface, and surface soil temperatures is essential for efficient decision-making. This study employed an optimized two-dimensional convolutional neural network (CNN) coupled with a single-layer long short-term memory (LSTM) model to forecast hourly spatiotemporal soil temperatures at a depth of 0-7 cm. The model was trained on annual hourly time-series spatiotemporal soil temperature data and evaluated across five climatic zones in Canada and the US: humid subtropical, humid continental-hot summer, polar tundra, subarctic-cool summer, and humid continental-mild summer. The results showed that the CNN-LSTM model accurately predicts spatiotemporal soil temperatures across these climates, with training correlations ranging from 99.18 % to 99.69 % and testing correlations from 93.72 % to 99.24 %. The CNN-LSTM model outperformed the random forest (RF) and support vector regression (SVR) models in prediction accuracy. The CNN-LSTM achieved normalized root mean squared error (NRMSE) values ranging from 1.42 % to 3.63 % and coefficient of determination (R