A spatiotemporal empirical orthogonal function (STEOF) forecast method is proposed and used in medium- to long-term sea surface height anomaly (SSHA) forecast. This method embeds temporal information in empirical orthogonal function spatial patterns, effectively capturing the evolving spatial distribution of variables and avoiding the typical rapid accumulation of forecast errors. The forecast experiments are carried out for SSHA in the South China Sea to evaluate the proposed model. Experimental results demonstrate that the STEOF forecast method consistently outperforms the autoregressive integrated moving average (ARIMA), optimal climatic normal (OCN) and persistence prediction. The model accurately forecasts the intensity and location of ocean eddies, indicating its great potential for practical applications in medium- to long-term ocean forecasts.