Thirty patients undergoing gastroscopy received intravenous premedication with either midazolam or diazepam in a randomised double blind study. Mean dosages were similar for the midazolam (6.13 mg) and diazepam (6.4 mg) groups. Neuropsychological testing pre- and post-medication comprised the Wechsler Memory Scale, Complex Figure Test, Word Association Test, and a Tactile Memory Test. There was a significant impairment on post-medication tests requiring delayed recall of verbal, visual and tactile stimuli. Midazolam produced significantly greater anterograde amnesia than diazepam at similar mean dosages. With the exception of Digit Span and Associate Learning, cognitive tasks which do not require delayed recall were not affected. It is concluded that the amnesic deficit is discrete and not secondary to sedative effects.