Transplantation studies in mice and rats have shown that human embryonic-stem-cell-derived cardiomyocytes (hESC-CMs) can improve the function of infarcted hearts, but two critical issues related to their electrophysiological behaviour in vivo remain unresolved. First, the risk of arrhythmias following hESC-CM transplantation in injured hearts has not been determined. Second, the electromechanical integration of hESC-CMs in injured hearts has not been demonstrated, so it is unclear whether these cells improve contractile function directly through addition of new force-generating units. Here we use a guinea-pig model to show that hESC-CM grafts in injured hearts protect against arrhythmias and can contract synchronously with host muscle. Injured hearts with hESC-CM grafts show improved mechanical function and a significantly reduced incidence of both spontaneous and induced ventricular tachycardia. To assess the activity of hESC-CM grafts in vivo, we transplanted hESC-CMs expressing the genetically encoded calcium sensor, GCaMP3 (refs 4, 5). By correlating the GCaMP3 fluorescent signal with the host ECG, we found that grafts in uninjured hearts have consistent 1:1 host–graft coupling. Grafts in injured hearts are more heterogeneous and typically include both coupled and uncoupled regions. Thus, human myocardial grafts meet physiological criteria for true heart regeneration, providing support for the continued development of hESC-based cardiac therapies for both mechanical and electrical repair.