A new type of hybrid compound, combining properties of MOFs and borohydrides, was synthesized solvothermally using Mg(BH4)2 and imidazole as precursors. Material in the form of acetonitrile solvate with formula [Mg3{(Im)BH2(Im)}6(ImH)6]·CH3CN crystallizes in the space group R3̅, having the unit cell parameters a = 15.1942(2) Å and c = 28.3157(3) Å as determined by single crystal X-ray diffraction. The structure was further investigated by solid-state NMR and DFT quantum chemical calculations. The main feature of the structure, reported here for the first time, is a linear trinuclear complex, where octahedrally nitrogen-coordinated Mg2+ ions are bridged with {(Im)BH2(Im)}- units, forming inside voids of 4.6 Å in diameter between the magnesium ions. Polar intermolecular interactions hold the molecules in a dense rhombohedral stacking, where a disordered acetonitrile molecule plays a cohesive role. The compound is stable in air and upon heating to about 160 °C. Using an alternative synthesis method from an imidazole melt, an imidazole solvate with the formula [Mg3{(Im)BH2(Im)}6(ImH)6]·ImH and a very similar crystal structure to acetonitrile solvate was prepared. It is stable up to 220 °C. Upon further heating, it transformed into a layered structure with the formula Mg(Im3BH)2, space group P3̅1c, and unit cell parameters a = 8.7338(9) Å and c = 17.621(2) Å determined by synchrotron powder diffraction. Besides its structural novelty, two types of potentially reactive hydrogens, bonded to boron and nitrogen in the same molecule, make the material highly interesting for future investigations in the fields of energy storage applications.