The incorporation of magnesium ions into the hydroxyapatite structure, which is of great interest for the developing of artificial bone, was performed starting from a wet chemical synthesis using magnesium chloride as Mg source. Different doping extents were attempted, four powders were produced and characterized in term of morphology, composition, solubility, thermal resistance,etc. in comparison with stoichiometric HA. In vitro tests with mesenchimal stem cells (MSCs) and human osteoblast like cells MG-63 cells were performed with the powder characterized with a biological-like doping of 5%Mg. The same powder was used, in form of granules, to carry out in vivo test by filling a defect in the femur on New Zealand White rabbits. All the tests showed better performance of the Mg doped apatite compared to stoichiometric HA, in agreement with the chemico-physical features of the material.