Three accurate X-ray diffraction experiments (Mo Kalpha, T = 190, 240 and 298 K) were carried out to track the temperature dependence of the electron density in the cubic perovskite potassium manganese trifluoride, KMnF3, from room temperature to just above that of the phase transition to the tetragonal structure ( 186 K), and to correlate the parameters of the critical points with the phase-transition mechanism. The data obtained were approximated by the Hansen - Coppens multipole model expanded up to hexadecupoles; the anharmonicity of the atomic displacements up to the fourth level was considered. Topological analysis shows only two types of chemical bond at room temperature, Mn - F and K - F. However, at low temperature the K - F bonds blocking the rotation of the MnF6 octahedra are weakened and new Mn K bonds are formed to keep the crystal structure from disintegrating. The Mn - K bonds become stronger as the temperature approaches 186 K. This rearrangement of chemical bonds can be regarded as a precursor effect, which starts 50-60degrees above the phase-transition temperature. The effective one-particle potential of the F atom has a single minimum at 298 K and four well separated minima ( with a shift of 0.2 Angstrom from the equilibrium position towards the structural holes) at 190 K. Parameters of the critical points of the electron density indicate closed-shell type interactions between K - F and Mn - K pairs, whereas the Mn - F bond can be considered as an intermediate type. The topology of the electrostatic potentials is discussed as well.