Rationale: Identifying the long-term neurocognitive sequelae of drug addiction may have important implications for understanding the compulsive, chronically relapsing nature of this brain disorder. Objectives: Our aim was to investigate the consequences of chronic intravenous self-administration of cocaine or heroin on visual attentional processes in rats. Methods: Adult male rats were pretrained on a five-choice serial reaction time task (5-CSRTT) of sustained visual attention and impulsivity and later trained to self-administer cocaine or heroin intravenously during multiple 'long-access' self-administration cycles. Control rats had identical training and surgical experience, but received passive infusions of saline during self-administration sessions. Executive cognitive processes of selection and inhibitory response control were evaluated 24 h after drug discontinuation and for a further 6 days prior to the next cycle of self-administration. Results: Findings indicate similar behavioural disturbances on the five-choice task in cocaine- and heroin-withdrawn rats with significantly impaired attentional accuracy, increased omissions and slower latencies to respond correctly during the early, but not late, withdrawal period. The self-administration of either drug was not associated with significant alterations in impulsive actions, and there was no evidence of persistent alterations in visual attentional performance. However, unlike rats self-administering cocaine, the motivation to collect food reward on the 5-CSRTT was significantly reduced in heroin-withdrawn animals for a period of at least 6 weeks. Conclusions: These data, together with recent findings of attentional dysfunction during the withdrawal of intravenous self-administration of amphetamine, suggest that generically different drugs of abuse produce similar disturbances in visual attentional performance during the early withdrawal period.