The most damaging citrus diseases are Huanglongbing (HLB) and citrus canker, which are caused by Candidatus Liberibacter asiaticus (CaLas) and Xanthomonas citri pv. citri (Xcc), respectively. Endolysins from bacteriophages are a possible option for disease resistance in plant breeding. Here, we report improvement of citrus resistance to HLB and citrus canker using the LasLYS1 and LasLYS2 endolysins from CaLas. LasLYS2 demonstrated bactericidal efficacy against several Rhizobiaceae bacteria and Xcc, according to inhibition zone analyses. The two genes, driven by a strong promoter from Cauliflower mosaic virus, 35S, were integrated into Carrizo citrange via Agrobacterium-mediated transformation. More than 2 years of greenhouse testing indicated that LasLYS2 provided substantial and long-lasting resistance to HLB, allowing transgenic plants to retain low CaLas titers and no obvious symptoms while also clearing CaLas from infected plants in the long term. LasLYS2 transgenic plants with improved HLB resistance also showed resistance to Xcc, indicating that LasLYS2 had dual resistance to HLB and citrus canker. A microbiome study of transgenic plants revealed that the endolysins repressed Xanthomonadaceae and Rhizobiaceae populations in roots while increasing Burkholderiaceae and Rhodanobacteraceae populations, which might boost the citrus defense response, according to transcriptome analysis. We also found that Lyz domain 2 is the key bactericidal motif of LasLYS1 and LasLYS2. Four endolysins with potential resistance to HLB and citrus canker were found based on the structures of LasLYS1 and LasLYS2. Overall, the work shed light on the mechanisms of resistance of CaLas-derived endolysins, providing insights for designing endolysins to develop broad-spectrum disease resistance in citrus.