Ca8MgR(PO4)7 (R = La, Pr, Nd, Sm−Lu, and Y) phosphates with a β-Ca3(PO4)2 related structure were prepared by a standard solid-state method in air. Second-harmonic generation, differential scanning calorimetry, and dielectric measurements led to the conclusion that all Ca8MgR(PO4)7 are centrosymmetric and go to another centrosymmetric phase in the course of a first-order antiferroelectric phase transition well above room temperature (RT). High-temperature electron diffraction showed that the symmetry changes from R3¯c to R3¯m during the phase transition. Structures of Ca8MgR(PO4)7 at RT were refined by the Rietveld method in centrosymmetric space group R3¯c. Mg2+ cations occupy the M5 site; the occupancy of the M1 site by R3+ cations increases monotonically from 0.0389 for R = La to 0.1667 for R = Er-Lu, whereas the occupancy of the M3 site by R3+ cations decreases monotonically from 0.1278 for R = La to 0 for R = Er-Lu. In the case of R = Er-Lu, the M3 site is occupied only by Ca2+ cations. P1O4 tetrahedra and cations at the M3 site are disordered in the R3¯c structure of Ca8MgR(PO4)7. Using synchrotron X-ray powder diffraction, we found that annealing conditions do not significantly affect the distribution of Ca2+ and Eu3+ cations between the structure positions of Ca8MgEu(PO4)7. Luminescent properties of Ca8MgEu(PO4)7 powder samples were investigated under near-ultraviolet (n-UV) light. Excitation spectra of Ca8MgEu(PO4)7 show the strongest absorption at about 395 nm that matches with commercially available n-UV-emitting GaN-based LED chips. Emission spectra show an intense red emission due to the 5D0 → 7F2 transition of Eu3+.