To investigate the influence of pain exposure on autonomic nervous system of newborns, and develop a detection model based on heart rate variability (HRV) indexes, 40 newborns are recruited in the study and short-term HRV analyses are performed on electrocardiogram before and after pain exposure using time-domain, frequency domain and nonlinear methods. Wilcoxon signed rank test is adopted for statistical comparison, and the support vector machine (SVM) is used for developing a detection model. The results demonstrate that 3 linear indexes such as the mean of RR intervals aRR, absolute powers of low frequency band LF and absolute powers of high frequency band HF, and 9 nonlinear indexes such as approximate entropy ApEn, sample entropy SampEn, and determinism DET before pain exposure are significantly different from after pain exposure; and that a detection accuracy of 83.75% could be achieved by the model based on the combination of 5 indexes, i.e., aRR, proportion of adjacent intervals greater than 50 ms pNN50, ApEn, correlation dimension D2 and recurrence rate REC, and SVM. It suggests that HRV indexes can reveal the response of autonomous nervous system to pain exposure of newborns, and the model based on HRV indexes and SVM could be employed for the detection of pain.