The effect of temperature on the luminescence properties of LiMgPO4 doped with Eu(3+) and Eu(2+) are presented. Depending on the excitation wavelength, luminescence spectra consist of two distinct broad emission bands peaking at 380 nm and 490 nm related to 4f(6)5d(1) → 4f(7) ((8)S7/2) luminescence of Eu(2+) and to europium-trapped exciton, respectively, and/or several sharp lines between the 580 nm and 710 nm region, ascribed to the (5)D0 → (7)FJ (J = 0, 1, 2, 3 and 4) transitions in Eu(3+). To explain all the features of the Eu(2+) and Eu(3+) luminescence we discussed the existence of two different Eu sites substituting for Li(+), with short and long distance compensation. The evident effect of increasing the intensity of the Eu(2+) luminescence with increasing temperature was observed. It was considered that the charge compensation mechanism for Eu(3+) and Li(+) as well as Eu(2+) replacing Li(+) in the LiMgPO4 is a long distance compensation that allows for the existence of some of the europium ions either as Eu(3+) at low temperature or as Eu(2+) at high temperature. We concluded that Eu(2+) in the Li(+) site with long distance compensation yields only 4f(6)5d(1) → 4f(7) luminescence, whereas Eu(2+) in the Li(+) site with short distance compensation yields 4f(6)5d(1) → 4f(7) luminescence and europium-trapped exciton emission.