Low long-term heart rate variability (HRV), often observed in obstructive sleep apnea (OSA) patients, is a known risk factor for cardiovascular diseases. However, it is unclear how the type or duration of individual respiratory events modulate ultra-short-term HRV and beat-to-beat intervals (RR intervals). We aimed to examine the sex-specific changes in RR interval and ultra-short-term HRV during and after apneas and hypopneas of various durations. Electrocardiography signals, recorded as a part of clinical polysomnography, of 758 patients (396 men) with suspected OSA were analysed retrospectively. Average RR intervals and time-domain HRV parameters were determined during the respiratory event and the 15-s period immediately after the event. Parameters were analysed in three pooled sex-specific subgroups based on the respiratory event duration (10-20 s, 20-30 s, and > 30 s) separately for apneas and hypopneas. We observed that RR intervals shortened after the respiratory events and the magnitude of these changes increased in both sexes as the respiratory event duration increased. Furthermore, ultra-short-term HRV generally increased as the respiratory event duration increased. Apneas caused higher ultra-short-term HRV and a stronger decrease in RR interval compared to hypopneas. In conclusion, the respiratory event type and duration modulate ultra-short-term HRV and RR intervals. Considering HRV and the respiratory event characteristics in the diagnosis of OSA could be useful when assessing the cardiac consequences of OSA in a more detailed manner.