Temperature transformation of biogenic and synthetic Mg-containing apatite with β-tricalcium-magnesium phosphate (β-TCMP) formation was investigated by X-ray diffraction. Samples were annealed in air at the temperature range from 600 to 1200 °C at intervals 100 °C and cooled down to room temperature. The appearance of β-TCMP was ascertained in samples annealed at 800 °C. As revealed, the relative amount of β-TCMP increases and Mg concentration in this phase decreases as the annealing temperature is raised. While this, the replacement degree of Ca by Mg in the β-TCMP lattice is the annealing temperature function and does not depend either on sample origin (biogenic/synthetic) or on initial Mg concentration. The results of present work together with other investigation data testify to a high thermally activated mobility of Mg both in structure of Mg-containing apatites and in the structure of β-TCMP formed after thermal decomposition. Obtained data can be used for new biomaterials design with varied prolongation of Mg released into the living biological tissue.