Developing electrochemical high-energy storage systems is of crucial importance towards a green and sustainable energy supply. A promising candidate is fluoride ion batteries (FIBs), which can deliver a higher energy density than is possible with lithium ion batteries1,2. However, conversion-type reactions with metal fluorides causes a poor electrochemical reversibility1,3,4. Recently, layered perovskite oxides such as LaSrMnO4 have been shown to undergo topotactic electrochemical (de)fluorination, but they have low reversible discharge capacities (25 ~ 100 mAh/g) and poor rate capabilities. Here we show that a double-layered perovskite oxyfluoride La1.2Sr1.8Mn2O7–δF2 exhibits topotactic (de)intercalation reaction inside the rock-salt slabs, achieving a large reversible capacity of 535 mAh/cm3 (0 ≤ x ≤ 2 in La1.2Sr1.8Mn2O7–δFx), with excellent cycle stability and rate capability. Surprisingly, despite the close-packed perovskite-based structure, two extra fluoride ions are (de)intercalated beyond x = 2, leading to a reversible capacity of 1168 mAh/cm3 (0 ≤ x ≤ 4). During the further intercalation, oxygen molecules are formed in the perovskite layer, as in Na0.75[ Li0.25Mn0.75 ]O25, which is responsible for the charge compensation (i.e. anion redox)5,6 and the concomitant formation of oxygen vacancies that allow the incorporation of the excess fluoride ions. These results highlight the layered perovskite oxide/oxyfluorides as a new class of active materials for the construction of high-performance FIBs. More generally, the concept of anion-intercalation through O2 formation in the mixed-anion perovskite materials can be used to develop new functionalities.