In healthy individuals, caffeine intake may improve performance on cognitive tests. Obstructive sleep apnea (OSA) is a disorder that has been associated with impaired cognitive function. In this study, we investigated whether increased caffeine intake in untreated patients with OSA is linked to better cognitive performance. Forty-five untreated OSA patients underwent baseline polysomnography after completing a survey of 24-h caffeine intake. Participants completed a battery of neuropsychological tests, then demographically corrected T scores and a global deficit score (GDS) were calculated on these tests. Partial correlation analysis was performed to compare daily caffeine intake with GDS, after controlling for body mass index (BMI) and sleep apnea severity. Analysis of covariance was done to examine differences in daily caffeine intake between cognitively impaired (GDS >or= 0.5) and non-impaired (GDS < 0.5) individuals. Seven out of the 45 subjects met the criteria (GDS >or= 0.5) for cognitive impairment. There was a significant inverse association between caffeine intake and the GDS, both when controlling for BMI (r =or -0.331, p = 0.04) and when controlling for BMI and apnea severity (r =or-0.500, p = 0.002); those with less impairment consumed more caffeine. Analysis of covariance demonstrated that cognitively impaired individuals consumed one-sixth as much caffeine as non-impaired individuals (p < 0.05). In patients with moderately severe OSA, higher average daily caffeine intake was associated with less cognitive impairment.