A cellular automaton (CA) model has been developed for simulating the microstructure evolution and dendrite morphology of cast magnesium alloys. The growth kinetics of dendrite tips is determined by the difference between local equilibrium composition and local actual composition obtained by solving the solute transport equation. Two sets of meshes, a hexagonal mesh and an orthogonal mesh, are used in the model to perform the simulation. The hexagonal mesh is used to perform CA calculation to reflect the texture of Mg alloy dendrites, and the orthogonal mesh is used to solve the solute transport equations. The model was applied to simulate single dendrite evolution and columnar dendrites growth of AZ91D Mg alloy, as well as multi-grain growth of Mg-10Gd-2Y-0.5Zr (wt%) Mg alloy. Permanent mold step-shaped castings of the two Mg alloys were poured and metallographic examinations were carried out for validating the present model. The simulation results agree well with metallographic results. The model can be applied to simulate the microstructure evolution and dendrite morphology of magnesium alloys.