Reliable decoding of motor imagery (MI) from electroencephalography (EEG) signals remains a core challenge in brain—computer interface (BCI) research, owing to their low signal-to-noise ratio and intricate spatial—temporal dynamics. To address these issues, we propose ST-Mamba, a unified Spatial—Temporal Attentional Convolutional Network with a Dual-Branch BiMamba Encoder for efficient EEG representation learning. The proposed Attention-Guided Spatial—Temporal (AGST) module leverages hierarchical convolution and grouped attention to extract discriminative multiscale features, yielding compact spatio-temporal embeddings. Building on recent advances in state-space modeling, the BiMamba encoder employs bidirectional selective state updates to capture long-range temporal continuity and interchannel correlations with linear computational complexity. A lightweight Temporal Convolutional Network (TCN) further refines sequential dynamics to enhance decoding stability. Comprehensive evaluation on the BCI Competition IV-2a dataset demonstrates ST-Mamba's superior performance in both within-subject and cross-subject settings. These results validate the efficacy of combining state-space modeling with attention mechanisms for robust EEG-based MI decoding.