Background and purpose: Prolonged wakefulness impairs sustained vigilant attention as measured with the psychomotor vigilance task (PVT) and induces a compensatory increase in sleep intensity in recovery sleep as quantified by slow-wave activity (SWA) in the sleep electroencephalogram (EEG). These effects of sleep deprivation are counteracted by the adenosine receptor antagonist caffeine, suggesting that the adenosine neuromodulator/receptor system is importantly involved. To examine a role for A(2A) receptors, we investigated whether variation of the A(2A) receptor gene (ADORA2A) modulates the effects of caffeine on PVT and SWA after sleep deprivation. Experimental approach: We performed in 82 volunteers a haplotype analysis of 8 single nucleotide polymorphisms of ADORA2A. In 45 young men carrying 5 different allele combinations, we investigated the effects of prolonged waking and 2 x 200 mg caffeine or 2 x 100 mg modafinil on psychomotor vigilance, sleepiness, and the waking and sleep EEG. Key results: Throughout extended wakefulness, the carriers of haplotype HT4 performed faster on the PVT than carriers of non-HT4 haplotype alleles. In haplotype HT4, caffeine failed to counteract the waking-induced impairment of PVT performance and the rebound of SWA in recovery sleep. By contrast, caffeine was effective in non-HT4 allele carriers, and modafinil reduced the consequences of prolonged waking independently of ADORA2A haplotype. Conclusions and implications: Common genetic variation of ADORA2A is an important determinant of psychomotor vigilance in rested and sleep-deprived state. It also modulates individual responses to caffeine after sleep deprivation. These findings demonstrate a role for A(2A) receptors in the effects of prolonged wakefulness on vigilant attention and the sleep EEG.