The research interest in deep donors in silicon is due in particular to the quantum structure of such centers; these are promising for application in silicon photonics in the mid-IR range and quantum technologies. At interstitial lattice positions, magnesium atoms create double-charge deep donors. The review is an attempt to summarize the accumulated knowledge on properties of magnesium impurity in silicon. Among methods to obtain magnesium-doped silicon, there is focus on the impurity diffusion from the solid phase using the so-called sandwich method. Techniques to investigate samples include Hall effect measurements, optical absorption, luminescence spectroscopy, and others. The diffusivity of magnesium in silicon and stability of parameters of doped samples under heat treatment is discussed. The energy spectrum of the helium-like magnesium donor is considered in detail. Due to the interaction with other impurities, magnesium forms a variety of donor levels in silicon. These include complexes of Mg with substitutional acceptor atoms B, Al, Ga, In, interstitial Li, and oxygen, as well as numerous donors with a currently unknown nature. Some defects are similar to so-called thermal donors in silicon. The pairing of Mg atoms is proved in samples prepared from the isotope 28 Si-enriched silicon.