We report a direct observation of the microscopic origin of the bipolar resistive switching behavior in nanoscale titanium oxide films. Through a high-resolution transmission electron microscopy, an analytical transmission electron microscopy technique using energy-filtering transmission electron microscopy, and an in situ x-ray photoelectron spectroscopy, we demonstrated that the oxygen ions piled up at the top interface by an oxidation-reduction between the titanium oxide layer and the top Al metal electrode. We also found that the drift of oxygen ions during the on/off switching induced the bipolar resistive switching in the titanium oxide thin films. (C) 2009 American Institute of Physics. [doi: 10.1063/1.3251784]