The high-pressure structural behaviour of the flouroperovskite KMgF 3 is investigated by theory and experiment. Density functional calculations were performed within the local density approximation and the generalized gradient approximation for exchange and correlation effects, as implemented within the full-potential linear muffin-tin orbital method. In situ high-pressure powder x-ray diffraction experiments were performed up to a maximum pressure of 40 GPa using synchrotron radiation. We find that the cubic P m3m crystal symmetry persists throughout the pressure range studied. The calculated ground state properties -the equilibrium lattice constant, bulk modulus and elastic constants -are in good agreement with experimental results. By analyzing the ratio between the bulk and shear modulii, we conclude that KMgF 3 is brittle in nature.Under ambient conditions, KMgF 3 is found to be an indirect gap insulator with the gap increasing under pressure.