Iron is the most abundant transition-metal element in the mantle and therefore plays an important role in the geochemistry and geodynamics of the Earth's interior. Pressure-induced electronic spin transitions of iron occur in magnesiowüstite, silicate perovskite and post-perovskite. Here we have studied the spin states of iron in magnesiowüstite and the isolated effects of the electronic transitions on the elasticity of magnesiowüstite with in situ X-ray emission spectroscopy and X-ray diffraction to pressures of the lowermost mantle. An observed high-spin to low-spin transition of iron in magnesiowüstite results in an abnormal compressional behaviour between the high-spin and the low-spin states. The high-pressure, low-spin state exhibits a much higher bulk modulus and bulk sound velocity than the low-pressure, high-spin state; the bulk modulus jumps by approximately 35 percent and bulk sound velocity increases by approximately 15 percent across the transition in (Mg0.83,Fe0.17)O. Although no significant density change is observed across the electronic transition, the jump in the sound velocities and the bulk modulus across the transition provides an additional explanation for the seismic wave heterogeneity in the lowermost mantle. The transition also affects current interpretations of the geophysical and geochemical models using extrapolated or calculated thermal equation-of-state data without considering the effects of the electronic transition.