A novel magnesium metal-organic framework formulated as [Amim]2[Mg3(1,4-NDC)4(MeIm)2(H2O)2]·2H2O (1) (Amim = 1-propylene-3-methylimidazolium, 1,4-NDCH2 = 1,4-naphthalene dicarboxylic acid, MeIm = 1-methyl imidazole) was synthesized in an ionothermal reaction by using an ionic liquid 1-propylene-3-methylimidazolium chloride (AmimCl) as solvent and reactant. The coordinated MeIm was in situ produced by the decomposition of AmimCl during the ionothermal synthesis. Single-crystal X-ray analysis reveals that 1 crystallizes in the monoclinic system, space group P21/n. Its structure is composed of linear trinuclear magnesium clusters as secondary building units and features an anionic three-dimensional (3D) framework with 424·64 topology built upon 8-connected net. The thermal stability of 1 has also been studied.