Twenty ternary magnesium based phases (fourteen of them for the first time) have been prepared by reacting the elements at high temperature. Their crystal structures were studied by means of powder X-ray diffraction. RE x Mg 1-x Al 2 (RE = Gd, Tb, Dy, Ho, Er, Yb and Tm) crystallize with the MgNi 2 structure type, RE 3 Ag 5±x Mg 11±x (RE = Ce, Pr, Nd and Sm) with the Gd 3 Ru 4 Al 12 structure type, REAg 4+x Mg 2-x (RE = Ce and Pr) with the YbMo 2 Al 4 structure type, RE 4 Ag 10.3 Mg 12 (RE = Ce, Pr and Nd) with the La 4 Ag 10.3 Mg 12 structure type and RE 4 Ag 10+x Mg 3-x (RE = Ce, Pr, Nd and Sm) with the Ca 4 Au 10 In 3 structure type. Description of the structures in terms of interatomic relations and coordination are briefly discussed.