ABSTRACT Magnesium dicarbide (MgC2) at high pressure has been systematically investigated using the first-principle methods. Ten possible structures were studied and three of them (Cmcm, C2/m, P-3m1) were found to be dynamically and mechanically stable under the given pressure. The calculated formation enthalpies indicated that the Cmcm structure was thermodynamically unstable while the C2/m and P-3m1 structures were thermodynamically stable. The interesting thing was that the P-3m1 structure of MgC2 could also be as potential hard materials owing to their Vickers hardness closing to 40 GPa with increasing pressure. The Cmcm and C2/m structures presented ductile behaviour while P-3m1 structure displayed brittle character. The elastic anisotropy of Young’s modulus E and shear modulus G became smaller with the increasing pressure, and the P-3m1 structure possessed a lower anisotropy in E and G than Cmcm and C2/m structures. The Cmcm and C2/m structures of MgC2 had metallic characteristic; however, the P-3m1 structure of MgC2 was semiconductor with an indirect band gap.