Sexual dysfunction is a major contributor to treatment discontinuation and nonadherence among patients treated with selective serotonin reuptake inhibitors (SSRIs). The mechanisms by which depressive symptoms in general, as well as SSRI exposure in particular, may worsen sexual function are not known. We examined genetic polymorphisms, including those of the serotonin and glutamate systems, for association with erectile dysfunction, anorgasmia, and decreased libido during citalopram treatment. Clinical data were drawn from a nested case–control cohort derived from the STAR*D study, a multicenter, prospective, effectiveness trial in outpatients with nonpsychotic major depressive disorder (MDD). Self-reports of erectile dysfunction, decreased libido, or difficulty achieving orgasm based on the Patient-Rated Inventory of Side Effects were examined among Caucasian subjects (n=1473) for whom DNA and adverse effect measures were available, and who were treated openly with citalopram for up to 14 weeks. Of 1473 participants, 799 (54%) reported decreased libido; 525 (36%) reported difficulty achieving orgasm. Of 574 men, 211 (37%) reported erectile dysfunction. Using a set-based test for association, single nucleotide polymorphisms in glutamatergic genes were associated with decreased libido (GRIA3; GRIK2), difficulty achieving orgasm (GRIA1), and difficulty achieving erection (GRIN3A) (experiment-wide permuted p<0.05 for each). Evidence of association persisted after adjustment for baseline clinical and sociodemographic differences. Likewise, evidence of association was similar when the cohort was limited to those who did not report a given adverse event at the first post-baseline visit (ie, those whose adverse events were known to be treatment emergent). These hypothesis-generating analyses suggest the potential for glutamatergic treatment targets for sexual dysfunction during major depressive episodes.