Conventional high-temperature reactions limit the control of coordination polyhedra in transition-metal oxides to those obtainable within the bounds of known coordination geometries for a given transition metal1. For example, iron atoms are almost exclusively coordinated by three-dimensional polyhedra such as tetrahedra and octahedra. However, recent works have shown that binary metal hydrides act as reducing agents at low temperatures, allowing access to unprecedented structures2, 3, 4. Here we show the reaction of a perovskite SrFeO3 with CaH2 to yield SrFeO2, a new compound bearing a square-planar oxygen coordination around Fe2+. SrFeO2 is isostructural with 'infinite layer' cupric oxides5, 6, 7, 8, and exhibits a magnetic order far above room temperature in spite of the two-dimensional structure, indicating strong in-layer magnetic interactions due to strong Fe d to O p hybridization. Surprisingly, SrFeO2 remains free from the structural instability that might well be expected at low temperatures owing to twofold orbital degeneracy in the Fe2+ ground state with D4h point symmetry. The reduction and the oxidation between SrFeO2 and SrFeO3 proceed via the brownmillerite-type intermediate SrFeO2.5, and start at the relatively low temperature of 400 K, making the material appealing for a variety of applications, including oxygen ion conduction, oxygen gas absorption and catalysis.