Spatially resolved transcriptomics are a set of emerging technologies that enable the transcriptomic profiling of tissues with the physical location of expressions. Although a variety of methods have been developed for data integration, most of them are for single-cell RNA-seq datasets without a consideration of spatial information. Thus, methods that are capable of integrating spatial transcriptomics data from multiple tissue slides, possibly from multiple individuals, are sincerely needed. Here, we present PRECAST, an efficient data integration method for multiple spatial transcriptomics data with non-cluster-relevant effects such as the complex batch effects. PRECAST unifies spatial factor analysis simultaneously with spatial clustering and embedding alignment, while requiring only partially shared cell/domain clusters across datasets. We showed that PRECAST effectively integrates multiple tissue slides with spots mixed across datasets and cell/domain clusters separated using both simulated datasets and four spatial transcriptomics datasets from either low- or near-single-cell-resolution sequencing. The method demonstrates improved cell/domain detection with outstanding visualization, and the estimated embeddings and cell/domain labels facilitate many downstream analyses. Using a hepatocellular carcinoma Visium dataset, PRECAST detected two cell lineages in tumor/normal epithelium via spatial RNA velocity analysis using its estimated embeddings and domain labels. We further showed the scalability of PRECAST with a mouse olfactory bulb Slide-seqV2 dataset for 16 slides with ∼600,000 spots.