Obstructive sleep apnea (OSA) causes e.g. intermittent blood oxygen desaturations increasing the sympathetic tone. Yet, the effect of desaturations on heart rate variability (HRV), a simple, non-invasive method for assessing sympathovagal balance, has not been comprehensively studied. We aimed to study whether the desaturation severity affects the immediate HRV. We retrospectively analysed the electrocardiography (ECG) signals in 5-minute segments (N=39 132), recorded during clinical polysomnography, of 642 suspected OSA patients. HRV parameters were calculated for each segment. The segments were pooled into severity groups based on the desaturation severity (DesSev, the integrated area under the blood oxygen saturation curve) and the respiratory event rate within the segment (Ev). Covariate-adjusted regression analyses were performed to investigate the possible confounding effects of e.g., comorbidities. With increasing Ev, the normalized high-frequency band power (HFNU) decreased from 0.517 to 0.364 (p<0.01), the normalized low-frequency band power (LFNU) increased from 0.483 to 0.636 (p<0.01), and the mean RR interval decreased from 915 to 869 ms (p<0.01). Similarly, with increasing DesSev, the HFNU decreased from 0.499 to 0.364 (p<0.01), the LFNU increased from 0.501 to 0.636 (p<0.01), and the mean RR interval decreased from 952 to 854 ms (p<0.01). DesSev-related findings were confirmed by considering the confounding factors in the regression analyses. In conclusion, the short-term HRV response differs based on the desaturation severity and the respiratory event rate in suspected OSA patients. Therefore, a more detailed analysis of the HRV and desaturation characteristics could enhance the OSA severity estimation.