During the last few years, magnesium (Mg) has been subject of research due to its functionality in the organism. It is one of the most important micronutrients, and therefore its role in biological systems has been extensively investigated. Particularly, Mg has a strong relation with the immune system, in both nonspecific and specific immune response, also known as innate and acquired immune response. The aim of this paper is to review the state of the art about the interactions between Mg and the immune system. We discuss the link between dietary Mg and inflammation, apoptosis and alterations in number and function of innate immune cell populations, described in animal models. Furthermore, the immune system can be compromised in human populations under certain circumstances, including athletes and elderly people. The importance of a balanced Mg homeostasis and its interaction with the immune system in these groups has also been reviewed. Although emerging data support the relevant role of Mg in the immune response, further research is needed; and special efforts should be made to establish the most adequate dose in nutritional supplements to reach beneficial effects on health.