Li 2− x Ta 2+ x N 4 (ca. 0.2< x<ca. 1) and Mg 2.6− x Ta 1.3+ x N 4 (ca. 0.3< x<ca. 1) were synthesized by reaction of Li 3N, or either Mg 3N 2 or Mg(NH 2) 2, with Ta 3N 5. The structure of Li 2− x Ta 2+ x N 4 was determined by single-crystal and that of Mg 2.6− x Ta 1.3+ x N 4 by powder X-ray diffraction. The crystals of both compounds are cubic ( Fm3 m; Z=1; a≈4.31 A ̊ (Li 2− x Ta 2+ x N 4) or a≈4.36 A ̊ (Mg 2.6− x Ta 1.3+ x N 4)) with an NaCl structure (cations disordered). Li 2− x Ta 2+ x N 4 ( x=0.4) can be described as a disordered high temperature phase of Li 2Ta 3N 5. Experiments aimed at attaining the tantalum-rich phase boundary for Li 2− x Ta 2+ x N 4 with x=1 (LiTa 3N 4) and for Mg 2.6− x Ta 1.3+ x N 4 with x=1. 6 (MgTa 3N 4) produced the new hexagonal phases Li 1− x Ta 3+ x N 4 (ca. 0.0⩽ x⩽ca. 0.02; P6 3/ mcm; Z=3; a=5.180 A ̊ ; c=10.343 A ̊ (for x=0.02)) and Mg 1− x Ta 2+ x N 3 (ca. 0.0 ⩽ x⩽ca. 0.06; P6 3/ mcm; Z=4; a=5.205 A ̊ ; c=10.425 A ̊ (for x=0.06)). Powder X-ray and neutron diffraction data were used for the structure determination. The structures are of a filled up 2H-MoS 2 type and contain (TaN 2) 3− layers between which Li + and Ta 5+ or Mg 2+ and Ta 5+ occupy octahedral holes surrounded by nitrogen.