Singly or doubly bonded polynitrogen compounds can decompose to dinitrogen (N2) with an extremely large energy release. This makes them attractive as potential explosives or propellants1,2,3, but also challenging to produce in a stable form. Polynitrogen materials containing nitrogen as the only element exist in the form of high-pressure polymeric phases4,5,6, but under ambient conditions even metastability is realized only in the presence of other elements that provide stabilization. An early example is the molecule phenylpentazole, with a five-membered all-nitrogen ring, which was first reported in the 1900s7and characterized in the 1950s8,9. Salts containing the azide anion (N3−)10,11,12or pentazenium cation (N5+)13are also known, with compounds containing the pentazole anion,cyclo-N5−, a more recent addition14,15,16. Very recently, a bulk material containing this species was reported17and then used to prepare the first example of a solid-state metal–N5 complex18. Here we report the synthesis and characterization of five metal pentazolate hydrate complexes [Na(H2O)(N5)].2H2O, [M(H2O)4(N5)2].4H2O (M = Mn, Fe and Co) and [Mg(H2O)6(N5)2].4H2O that, with the exception of the Co complex, exhibit good thermal stability with onset decomposition temperatures greater than 100 °C. For this series we find that the N5− ion can coordinate to the metal cation through either ionic or covalent interactions, and is stabilized through hydrogen-bonding interactions with water. Given their energetic properties and stability, pentazole–metal complexes might potentially serve as a new class of high-energy density materials19or enable the development of such materials containing only nitrogen20,21,22,23. We also anticipate that the adaptability of the N5− ion in terms of its bonding interactions will enable the exploration of inorganic nitrogen analogues of metallocenes24and other unusual polynitrogen complexes.