Total electron content (TEC) in the ionosphere is a crucial parameter affecting radio wave propagation and space activities. However, traditional statistical models exhibit significant limitations in handling the high noise, non-stationarity, and complex dynamic characteristics of TEC data. To address this issue, this study proposes a hybrid prediction model combining a SpatioTemporal Transformer (STT) and a long short-term memory (LSTM) network, with the incorporation of attention-weighted auxiliary predictors. In an experimental setting for ionospheric TEC prediction over China and its surrounding regions, data from 2000 to 2022 were used for training, while data from the solar maximum year 2023 served as the test set. The study focused on evaluating the impact of different parameter combinations on TEC prediction performance under varying ionospheric conditions. Ablation experiments demonstrate that the proposed hybrid model outperforms single models. The hybrid model with attention-weighted auxiliary predictors achieved an average relative accuracy (P) of 87.63% on the 2023 test set, compared to 87.45% for the single model. The highest average relative accuracy during geomagnetically quiet and storm periods reached 94.34% and 93.17%, respectively. Furthermore, during the longest geomagnetically quiet period (DOY 221–244) and storm period (DOY 166–181) in the test set, the average relative accuracy (P) reached 90.98% and 90.16%, respectively. These results indicate that the model maintains high TEC prediction accuracy under different ionospheric conditions.