Cerebral blood flow is thought to increase at high altitude and in subjects suffering from acute mountain sickness (AMS); however, data from the literature are contentious. Blood flow velocity in the middle cerebral artery (MCAv) may be used as a proxy measure of cerebral blood flow. Using transcranial Doppler sonography, MCAv was measured during normo- and hyper-ventilation in subjects who participated in a trial that tested the effect of magnesium supplementation on the prevention of AMS. First, MCAv was recorded at 353 m (baseline). Subjects were then randomized to receive oral magnesium citrate and matching placebo. A second measurement was taken after a 24 +/- 2 h ascent from 1130 m to 4559 m (altitude I), and a third after a 20-24 h stay at 4559 m (altitude II). Using multivariate linear regression, an association was sought between MCAv and magnesium supplementation, subjects' age and gender, altitude itself, a temporary stay at altitude, and the presence of AMS (Lake Louise Score >6 with ataxia, nausea and/or headache). Subjects with AMS had additional Doppler recordings immediately before and after rescue medication (oxygen, dexamethasone and acetazolamide). Forty-seven subjects had measurements at baseline, 39 (21 receiving magnesium and 18 placebo) at altitude I and 26 (13 receiving magnesium and 13 placebo) at altitude II. During hyperventilation, MCAv decreased consistently (for each measurement, P<0.001). Magnesium significantly increased MCAv by 8.4 cm.s(-1) (95% confidence interval, 1.8-15), but did not prevent AMS. No other factors were associated with MCAv. Eleven subjects had severe AMS [median score (range), 11 (8-16)] and, after rescue medication, the median score decreased to 3 (range, 0-5; P=0.001), but MCAv remained unchanged (65 +/- 18 cm.s(-1) before compared with 67 +/- 16 cm.s(-1) after rescue medication; P=0.79). MCAv was increased in subjects who received magnesium, but was not affected by exposure to high altitude or by severe AMS.