Electrode grids on the cortical surface of epileptic patients provide a unique opportunity to observe brain activity with high temporal-spatial resolution and high signal-to-noise ratio during a cognitive task. Previous work showed that large-amplitude theta frequency oscillations occurred intermittently during a maze navigation task, but it was unclear whether theta related to the spatial or working memory components of the task. To determine whether theta occurs during a nonspatial task, we made recordings while subjects performed the Sternberg working memory task. Our results show event-related theta and reveal a new phenomenon, the cognitive "gating" of a brain oscillation: at many cortical sites, the amplitude of theta oscillations increased dramatically at the start of the trial, continued through all phases of the trial, including the delay period, and decreased sharply at the end. Gating could be seen in individual trials and varying the duration of the trial systematically varied the period of gating. These results suggest that theta oscillations could have an important role in organizing multi-item working memory.