Spatial transcriptomics produces high-dimensional gene expression measurements with spatial context. Obtaining a biologically meaningful low-dimensional representation of such data is crucial for effective interpretation and downstream analysis. Here, we present Spatial Transcriptomics Analysis with topic Modeling to uncover spatial Patterns (STAMP), an interpretable spatially aware dimension reduction method built on a deep generative model that returns biologically relevant, low-dimensional spatial topics and associated gene modules. STAMP can analyze data ranging from a single section to multiple sections and from different technologies to time-series data, returning topics matching known biological domains and associated gene modules containing established markers highly ranked within. In a lung cancer sample, STAMP delineated cell states with supporting markers at a higher resolution than the original annotation and uncovered cancer-associated fibroblasts concentrated on the tumor edge’s exterior. In time-series data of mouse embryonic development, STAMP disentangled the erythro-myeloid hematopoiesis and hepatocytes developmental trajectories within the liver. STAMP is highly scalable and can handle more than 500,000 cells.