In polycrystalline materials, grain boundaries (GBs) play an important role in resisting crack growth. In this study, the interaction of a crack on basal plane with GBs in magnesium was investigated by molecular statics simulations. Three types of GBs with different mis-orientation angles were considered, i.e., [21¯1¯0] asymmetric tilt GB, (011¯0) twist GB and [0001] asymmetric tilt GB. Simulation results show that, for [21¯1¯0] asymmetric tilt GBs, the crack always penetrates through the GBs but the crack growth path in neighboring grain changes from (0001) basal plane to (01¯11) pyramidal plane as the tilt mis-orientation angle increases. For (011¯0) twist GBs, the crack propagation mechanism changes from trans-granular fracture into inter-granular fracture with the increasing twist mis-orientation angle. For [0001] asymmetric tilt GBs, trans-granular fracture happens at small and high tilt mis-orientation angles, while inter-granular fracture occurs at intermedium mis-orientation angles. The critical stress intensity factor (SIF) for crack propagation across or along GB is correlated with the corresponding GB energy. Trans-granular fracture occurs when the GB energy is low, and the critical SIF also increases with the increasing GB energy. For high energy GBs, inter-granular fracture occurs and the critical SIF changes hardly with the increasing GB energy. The current work provides insights into understanding the behavior of cracks and ductility enhancement in magnesium.