An ilmenite-like monoclinic phase of HgMnO3 with space group P21/c was prepared using high-pressure and high-temperature methods at 18 GPa and 1473 K. The MnO6 octahedra form a two-dimensional (2D) network in the bc plane, leading to a long-range antiferromagnetic ordering with a low Néel temperature of TN ∼ 32 K. As the synthesis pressure increases to 20 GPa, a new perovskite-like rhombohedral phase with space group R3̅c was found to occur. The rhombohedral phase exhibits a three-dimensional (3D) network for the MnO6 octahedra, giving rise to an antiferromagnetic ordering at TN ∼ 60 K. X-ray absorption spectroscopy confirms the invariable Mn4+ charge state in these two polymorphic phases, in agreement with the Curie-Weiss and bond valence sum analysis. HgMnO3 provides an interesting example to study the magnetic properties from 2D to 3D by varying synthesis pressure.