The electronic properties of correlated oxides are exceptionally sensitive to the orbital occupancy of electrons. Here we report an electron doping strategy via a chemical route, where interstitial dopants (for example, hydrogen) can be reversibly intercalated, realizing a sharp phase transition in a model correlated perovskite nickelate SmNiO 3 . The electron configuration of e g orbital of Ni 3 þ t 6 2g e 1 g in SmNiO 3 is modified by injecting and anchoring an extra electron, forming a strongly correlated Ni 2 þ t 6 2g e 2 g structure leading to the emergence of a new insulating phase. A reversible resistivity modulation greater than eight orders of magnitude is demonstrated at room temperature. A solid-state room temperature nonvolatile proton-gated phase-change transistor is demonstrated based on this principle, which may inform new materials design for correlated oxide devices. Electron doping-driven phase transition accompanied by large conductance changes and band gap modulation opens up new directions to explore emerging electronic and photonic devices with correlated oxide systems.