Rejection of the pulse related artefact (PRA) from electroencephalographic (EEG) time series recorded simultaneously with fMRI data is difficult, particularly during NREM sleep because of the similarities between sleep slow waves and PRA, in both temporal and frequency domains and the need to work with non-averaged data. Here we introduce an algorithm based on constrained independent component analysis (cICA) for PRA removal. This method has several advantages: (1) automatic detection of the components corresponding to the PRA; (2) stability of the solution and (3) computational treatability. Using multichannel EEG recordings obtained in a 3 T MR scanner, with and without concomitant fMRI acquisition, we provide evidence for the sensitivity and specificity of the method in rejecting PRA in various sleep and waking conditions.