The ab initio method is used to model the colour centers and self-trapped excit ons in KMgF33. The geometry optimization of the defect cluster, incl uding the F center, shows that the relaxation of the lattice around the F center is very small. The calculated Mulliken populations for F center in its ground state and excite state show that the ground state wavefunction of F center is well localized, but the excited state wavefunction of it is more diffuse. Furthermore, our results show that the VKK center moves toward the nearby interstitia l site , but keeping the molecular axis along the[110] direction. The relaxation of the self-trapped excitons consists of an axial translation superimposed wit h a rotation. The calculated excitation energies of F center, VKK ce nter a nd the emission energy of self-trapped exciton are compared with their experim ental values.