Dilated cardiomyopathy (DCM) is the leading cause of heart transplantation. By microRNA (miRNA) array, a Kaposi’s sarcoma-associated herpes virus (KSHV)-encoded miRNA, kshv-miR-K12-1-5p, was detected in patients with DCM. The KSHV DNA load and kshv-miR-K12-1-5p level in plasma from 696 patients with DCM were measured and these patients were followed-up. Increased KSHV seropositivity and quantitative titers were found in the patients with DCM compared with the non-DCM group (22.0% versus 9.1%,p< 0.05; 168 versus 14 copies/mL plasma,p< 0.05). The risk of the individual end point of death from cardiovascular causes or heart transplantation was increased among DCM patients with the KSHV DNA seropositivity during follow-up (adjusted hazard ratio 1.38, 95% confidence interval 1.01–1.90;p< 0.05). In heart tissues, the KSHV DNA load was also increased in the heart from patients with DCM in comparison with healthy donors (1016 versus 29 copies/105cells,p< 0.05). The KSHV and kshv-miR-K12-1-5p in DCM hearts were detected using immunofluorescence and fluorescence staining in situ hybridization. KSHV itself was exclusively detectable in CD31-positive endothelium, while kshv-miR-K12-1-5p could be detected in both endothelium and cardiomyocytes. Moreover, kshv-miR-K12-1-5p released by KSHV-infected cardiac endothelium could disrupt the type I interferon signaling pathway in cardiomyocytes. Two models of kshv-miR-K12-1-5p overexpression (agomiR and recombinant adeno-associated virus) were used to explore the roles of KSHV-encoded miRNA in vivo. The kshv-miR-K12-1-5p aggravated known cardiotropic viruses-induced cardiac dysfunction and inflammatory infiltration. In conclusion, KSHV infection was a risk factor for DCM, providing developmental insights of DCM involving virus and its miRNA (https://clinicaltrials.gov. Unique identifier: NCT03461107).