Electrically induced resistive switching in metal insulator-metal structures is a subject of increasing scientific interest because it is one of the alternatives that satisfies current requirements for universal non-volatile memories. However, the origin of the switching mechanism is still controversial. Here we report the fabrication of a resistive switching device inside a transmission electron microscope, made from a Pt/SiO 2 /a-Ta 2 O 5 À x /a-TaO 2 À x /Pt structure, which clearly shows reversible bipolar resistive switching behaviour. The currentvoltage measurements simultaneously confirm each of the resistance states (set, reset and breakdown). In situ scanning transmission electron microscope experiments verify, at the atomic scale, that the switching effects occur by the formation and annihilation of conducting channels between a top Pt electrode and a TaO 2 À x base layer, which consist of nanoscale TaO 1 À x filaments. Information on the structure and dimensions of conductive channels observed in situ offers great potential for designing resistive switching devices with the high endurance and large scalability.