SrMg2FeH8 and its deuteride were synthesized by reacting alkaline earth alloy powders of nominal composition SrMg2.2 with iron powder at 490-510-degrees-C and 130-140 bar hydrogen (deuterium) pressure, and characterized by X-ray and neutron powder diffraction. The compounds crystallize with a new trigonal structure type, space group P3m1BAR, and lattice parameters a = 4.5174(2) angstrom and c = 6.5807(4) angstrom (hydride), a = 4.5072(2) angstrom and c = 6.5663(4) angstrom (deuteride). The structure contains two types of deuterium atoms, one surrounding iron in an octahedral configuration with bond distances [Fe-D1] = 1.578(4) angstrom, and the other situated in a tetrahedral hole formed by one magnesium and three strontium atoms with bond distances [Mg-D2] = 1.919(7) angstrom, [Sr-D2] = 2.662(1) angstrom. The limiting ionic formula SrD2.Mg22+[FeD6]4- suggests that the transition metal complex conforms to the 18-electron rule.