Detection of near-threshold stimuli depends on the properties of the stimulus and the state of the observer. In visual detection tasks, improved accuracy is associated with larger prestimulus pupil size. However, it is still unclear whether this association is due to optical effects (more light entering the eye), correlations with arousal, correlations with cortical excitability (as reflected in alpha power), or a mix of these. To better understand this, we investigated the relative contributions of pupil size and power in the alpha, beta, and theta frequency bands on near-threshold detection. We found that larger prestimulus pupil size is associated with improved accuracy and more stimulus-present responses, and these effects were not mediated by spectral power in the EEG. Pupil size was also positively correlated with power in the beta and alpha bands. Taken together, our results show an independent effect of pupil size on detection performance that is not driven by cortical excitability but may be driven by optical effects, physiological arousal, or a mix of both.