Cognitive decline is a common complication after cardiac surgery with cardiopulmonary bypass (CPB), but as such no pharmacological therapy has been shown to be efficacious in preventing the decline. However, gastrodin has been shown to have multi-pharmacological effects on neurological functions. We undertook this study to test the hypothesis that gastrodin would potentially prevent CPB-associated neurocognitive decline. We randomly assigned 200 patients undergoing mitral valve replacement surgery to receive either gastrodin (40 mg/kg) or saline after the induction of anesthesia and subsequently evaluated cognitive function before surgery, at discharge, and at 3rd month after surgery by using a battery of five neurocognitive tests, or adverse effects of gastrodin postoperatively. Neurocognitive decline in postoperative function was defined as a drop of 1 SD or more in the scores on tests of any one of the four domains of cognitive function. Cognitive decline occurred in 9% of the patients in the gastrodin group in contrast to 42% in the control group (P<0.01) at discharge. Cognitive outcome could be determined at 3rd month in 87 patients in the gastrodin group and 89 in the control group. Cognitive decline was detected in 6% in the gastrodin group and 31% in the control group (P<0.01). The incidences of possible adverse effects were similar between two groups. These results indicate that gastrodin is an effective and a safe drug for the prevention of neurocognitive decline in patients undergoing mitral valve replacement surgery with CPB.