Background We aimed to investigate the effects of continuous positive airway pressure (CPAP) treatment on electrocardiography (ECG), premature ventricular contraction load on 24-hour Holter recordings, and implantable cardioverter defibrillator (ICD) shocks in patients with obstructive sleep apnea syndrome (OSAS) and heart failure. Methods Patients with heart failure and ICD and patients with newly diagnosed OSAS were divided into two groups according to CPAP treatment. To compare the impact of CPAP on ECG parameters, both baseline and 6-month ECG, 24-hour Holter ECG, ambulatory blood pressure monitoring, echocardiography, polysomnography, and laboratory parameters were collected. Results CPAP treatment significantly reduced the frequency of premature ventricular contractions, T-peak to T-end, corrected QT, corrected QT dispersion, and T-peak to T-end/corrected QT ratio in the study group (p < 0.001 for all). Although the baseline NT-pro-BNP levels were similar between study and control groups, after six months, the NT-pro-BNP levels of the study group were significantly lower than that of the control group (39.18 ± 7.57 versus 46.11 ± 7.65; p < 0.001). Conclusions CPAP treatment in patients with heart failure and ICD and in patients with newly diagnosed OSAS may have beneficial effects on premature ventricular contractions and electrocardiographic arrhythmia indices and NT-pro-BNP levels. However, these results are needed to be clarified with further studies.