BackgroundMale factors-caused decline in total fertility has raised significant concern worldwide. LncRNAs have been identified to play various roles in biological systems, including spermatogenesis. This study aimed to explore the role of lncRNA5251 in mouse spermatogenesis.MethodsThe expression of lncRNA5251 was modulated in mouse testes in vivo or spermatogonial stem cells (C18-4 cells) in vitro by shRNA.ResultsThe sperm motility in two generations mice after modulation of lncRNA5251 (muF0 and muF1) was decreased significantly after overexpression of lncRNA5251. GO enrichment analysis found that knockdown lncRNA5251 increased the expression of genes related to cell junctions, and genes important for spermatogenesis in mouse testes. Meanwhile, overexpressing lncRNA5251 decreased the gene and/or protein expression of important genes for spermatogenesis and immune pathways in mouse testes. In vitro, knockdown lncRNA5251 increased the expression of genes for cell junction, and the protein levels of some cell junction proteins such as CX37, OCLN, JAM1, VCAM1 and CADM2 in C18-4 cells. LncRNA5251 is involved in spermatogenesis by modulation of cell junctions.ConclusionThis will provide a theoretical basis for improving male reproductive ability via lncRNA.Supplementary InformationThe online version contains supplementary material available at 10.1186/s13062-023-00381-x.