We studied 26 patients in a double-blind investigation to compare psychomotor and cognitive recovery for 30 h after sedation for day-case gastroscopy with i.v. diazepam 0.15 mg kg-1 or midazolam 0.07 mg kg-1. Significantly more patients reported side effects at 7, 10 and 30 h post-gastroscopy after diazepam than after midazolam (P less than 0.05). Compared with baseline, the midazolam group was significantly impaired in critical flicker fusion threshold, reaction time, dexterity and visualization tasks up to 4 h after administration (P less than 0.05). There was a significant association between midazolam and amnesia for the procedure (P less than 0.001).