The structural, electronic, and mechanical stability properties of magnesium sulfide in different phases are presented using the plane wave pseudopotential method within the generalized gradient approximation. Eight different phases such as rocksalt (B1), zincblende (B3), wurtzite (B4), nickel arsenide (B8), cesium chloride (B2), PH4I-type (B11), FeSi-type (B28), and MnP-type (B31) are considered in great detail. The calculated ground-state properties of these phases are consistent with available experimental and theoretical data. It is found that MgS in the B1 and B8 phases are indirect band gap materials, the B3, B4, B11, B28, and B31 phases are all direct gap materials, while the B2 phase displays the metallic character. The B1, B3, B4, B8, B28, and B31 phases are mechanically stable at ambient conditions, but the B2 and B11 phases are mechanically unstable under zero pressure and zero temperature