During wakefulness, pyramidal neurons in the intact brain are bombarded by synaptic input that causes tonic depolarization, increased membrane conductance (i.e., shunting), and noisy fluctuations in membrane potential; by comparison, pyramidal neurons in acute slices typically experience little background input. Such differences in operating conditions can compromise extrapolation of in vitro data to explain neuronal operation in vivo. For instance, pyramidal neurons have been identified as integrators (i.e., class 1 neurons according to Hodgkin's classification of intrinsic excitability) based on in vitro experiments but that classification is inconsistent with the ability of hippocampal pyramidal neurons to oscillate/resonate at theta frequency since intrinsic oscillatory behavior is limited to class 2 neurons. Using long depolarizing stimuli and dynamic clamp to reproduce in vivo-like conditions in slice experiments, we show that CA1 hippocampal pyramidal cells switch from integrators to resonators, i.e., from class 1 to class 2 excitability. The switch is explained by increased outward current contributed by the M-type potassium current I(M), which shifts the balance of inward and outward currents active at perithreshold potentials and thereby converts the spike-initiating mechanism as predicted by dynamical analysis of our computational model. Perithreshold activation of I(M) is enhanced by the depolarizing shift in spike threshold caused by shunting and/or sodium channel inactivation secondary to tonic depolarization. Our conclusions were validated by multiple comparisons between simulation and experimental data. Thus even so-called "intrinsic" properties may differ qualitatively between in vitro and in vivo conditions.