The glucocorticoid receptor (GR) agonist dexamethasone is frequently used for its anti-inflammatory properties. We recently showed that a single high-dose of dexamethasone had long-lasting protective effects on the development of psychopathology after cardiac surgery and postoperative intensive care unit stay. In this study, we investigated whether common genetic variation in the hypothalamic-pituitary-adrenal (HPA)-axis would influence the susceptibility for PTSD and depression after dexamethasone administration. Participants (n = 996) of the Dexamethasone for Cardiac Surgery (DECS) randomized clinical trial were followed after receiving a single high intraoperative dose of dexamethasone (1 mg/kg), a GR agonist, or placebo. PTSD and depressive symptoms were assessed up to four years after cardiac surgery. We focused primarily on five common single nucleotide polymorphisms (SNPs) in the glucocorticoid receptor (GR). Secondarily, we comprehensively assessed common genetic variation in the FK506 binding protein (FKBP5) and the mineralocorticoid receptor (MR). The protective effects of dexamethasone on postoperative PTSD symptoms were dependent on the GR polymorphisms rs41423247 (p = .009), rs10052957 (p = .003), and rs6189 (p = .002), but not on rs6195 (p = .025) or rs6198, (p = .026) after Bonferroni correction. No genotype-dependent effects were found for postoperative depressive symptoms. Also, no associations of FKBP5 and MR polymorphisms were found on PTSD and depression outcomes. Protective effects of dexamethasone on PTSD symptoms after cardiac surgery and ICU stay seem to depend on common genetic variation in its target receptor, the GR. These effects indicate that pre-operative genetic screening could potentially help in stratifying patients for their vulnerability for developing PTSD symptoms after surgery.