To overcome the disadvantage of clinical manual sleep staging, a convenient, economical, and efficient multi-class automatic sleep staging method is proposed based on long short-term memory network (LSTM) using single-lead electrocardiogram signals. From electrocardiogram signals, heart rate variability and respiratory signals were calculated, and, then, totally 25 features were extracted. Four different classifiers, including the two-class classifier to distinguish between wake and sleep, the three-class classifier to distinguish wake, non-rapid eye movement sleep, and rapid eye movement, the four-class classifier to distinguish wake, light sleep, slow wave sleep, and rapid eye movement, and the five-class classifier to distinguish wake, sleep stage N1, sleep stage N2, sleep stage N3, and rapid eye movement, were constructed using the LSTM. The single-lead electrocardiogram data from 238 patients with full sleep stages during sleep were used for the training set and the data from other 60 patients were regarded as a validation set. The rest of 75 patients have left aside for testing set. The accuracy of two-class, three-class, four-class, and five-class sleep staging was 89.84%, 84.07%, 77.76%, and 71.16% and the Cohen's kappa statistic k was 0.52, 0.58, 0.55, and 0.52, respectively, which realized the moderate agreement with clinical analysis. When expanding the dataset to extra 1068 patients with missing sleep stages, the accuracy has no obvious reduction but the Cohen's kappa statistic k dropped to 0.51, 0.52, 0.48, and 0.43, respectively. The proposed method, in this paper, is promising for low-cost, efficient, and convenient sleep staging in home care monitoring. INDEX TERMS Electrocardiogram, heart rate variability, long short-term memory, sleep staging.