Background The gene encoding Catechol O-methyltransferase (COMT), a dopamine catabolic enzyme, is an important candidate gene in several psychiatric disorders. Several studies have shown an association between the functional Val158Met polymorphism and cognitive performance. However, the results have been inconsistent and there are few studies addressing other COMT single nucleotide polymorphisms (SNPs). Methods We investigated SNPs across the whole COMT gene, including the Val158Met polymorphism, for a putative effect on working memory, executive function and IQ in 315 patients with schizophrenia or bipolar disorder and 340 healthy controls. Results We replicated the association between the Val158Met variant and working memory performance, and found a significant interaction between this SNP and diagnosis, with patients with schizophrenia showing a specific, reduced performance on the 2-back test. Several other COMT SNPs were associated with different cognitive functions, but did not remain significant after controlling for multiple testing. We also found significant interaction effects between the SNP variants and gender. Conclusions The present study replicates earlier findings showing an association between the functional Val158Met polymorphism and working memory performance, with schizophrenia subjects particularly vulnerable. Furthermore, our findings suggest that other parts of the COMT gene seem to affect several related cognitive domains, which further support the notion that COMT is a modifier gene in prefrontal dopamine functioning.