Phase transitions that occur in materials, driven, for instance, by changes in temperature or pressure, can dramatically change the materials' properties. Discovering new types of transitions and understanding their mechanisms is important not only from a fundamental perspective, but also for practical applications. Here we investigate a recently discovered Fe4O5 that adopts an orthorhombic CaFe3O5-type crystal structure that features linear chains of Fe ions. On cooling below ∼150 K, Fe4O5 undergoes an unusual charge-ordering transition that involves competing dimeric and trimeric ordering within the chains of Fe ions. This transition is concurrent with a significant increase in electrical resistivity. Magnetic-susceptibility measurements and neutron diffraction establish the formation of a collinear antiferromagnetic order above room temperature and a spin canting at 85 K that gives rise to spontaneous magnetization. We discuss possible mechanisms of this transition and compare it with the trimeronic charge ordering observed in magnetite below the Verwey transition temperature.