Abstract With the rapid generation of spatial transcriptomics (ST) data, integrative analysis of multiple ST datasets from different conditions, technologies, and developmental stages is becoming increasingly important. However, identifying shared and specific spatial domains across ST datasets of multiple slices remains challenging. To this end, we develop a graph attention neural network STAligner for integrating and aligning ST datasets, enabling spatially-aware data integration, simultaneous spatial domain identification, and downstream comparative analysis. We apply STAligner to the integrative analysis of ST datasets of the human cortex slices from different samples, the mouse olfactory bulb slices generated by two profiling technologies, the mouse hippocampus tissue slices under normal and Alzheimer’s disease conditions, and the spatiotemporal atlases of mouse organogenesis. STAligner efficiently captures the shared tissue structures across different slices, the disease-related substructures, and the dynamical changes during mouse embryonic development. Additionally, the shared spatial domain and nearest neighbor pairs identified by STAligner can be further considered as corresponding pairs to guide the three-dimensional reconstruction of consecutive slices, achieving more accurate local structure-guided registration results than the existing method.