The mechanisms underlying memory functions during withdrawal from the chronic drug use are poorly understood. We assessed learning and spatial working memory using the delayed alternation assay (T-maze) in rats, previously subjected to cocaine self-administration. The T-maze training was conducted 1-5 weeks after cocaine cessation; working memory efficacy was assessed at 5-8 weeks of drug withdrawal. After behavioral training and testing, the rats were sacrificed and the levels of p-CREB/CREB and p-ERK2/ERK2 in several brain areas were measured. The same molecular assessment was performed in rats with cocaine injections, but forced to drug abstinence in home cages. After 5 weeks of cocaine withdrawal from self-administration, a significant impairment of working memory under increased working memory load (inter-trial delay extended to 30s), with no changes at baseline conditions (inter-trial delay 10s), was noticed. Neither acquisition phase nor working memory performance measured 6-8 weeks after the last drug intake differed between cocaine or saline pretreated rats. Upon T-maze training and 8-week withdrawal, cocaine-pretreated rats had higher levels of p-CREB/CREB in prefrontal cortex and dorsal striatum and lower in hippocampus compared to saline rats. Increased levels of p-ERK2/ERK2 were observed in dorsal striatum, hippocampus and decreased in nucleus accumbens. In cocaine-pretreated caged rats no changes in p-CREB/CREB levels were observed, while ERK2 levels either decreased (frontal cortex) or increased (nucleus accumbens). Our results suggest that cocaine self-administration results in cognitive impairments and alterations in ERK/CREB signaling pathway long after discontinuation of drug use.