The structure of a new magnesium nitridoboride, MgNB(9), has been refined from single-crystal X-ray data. The Mg and N atoms lie on sites with crystallographic 3m symmetry. The structure consists of two layers alternating along the c axis. The NB(6) layer, with B(12) icosahedra, has the C(2)B(13) structure type. Within this layer, boron icosahedra are bonded to N atoms, each coordinating to three boron polyhedra. Another MgB(3) layer, with B(6) octahedra, does not belong to any known structure type. The boron icosahedra and octahedra are connected to each other, thus forming a three-dimensional boron framework.