As a vital sign, Electrocardiogram (ECG) has highly discriminative characteristics in the field of biometrics. This paper aims to propose a novel robust ECG biometric method based on graph regularized non-negative matrix factorization (GNMF) and sparse representation. First, after ECG signal pre-processing and heartbeat segmentation, GNMF is used to reduce the dimensions of each heartbeat. In GNMF, an affinity graph is constructed to encode the geometrical information and label information in order to obtain more discriminative features. Second, in order to seek highly discriminability of ECG, the sparse representation is utilized to perform final feature extraction. We evaluate the method on two public datasets: ECG-ID and MIT-BIH Arrhythmia (MITDB). When fusing three heartbeats as a test sample, the accuracy achieves 98.03% and 100% on the ECG-ID dataset and the MITDB dataset, respectively. Experimental results show that the proposed method is robust for within-session and across-session of the ECG signal.