Abstract Cast AZ31 magnesium alloy was treated by the single-pass and two-pass friction stir processing (FSP), respectively, and the microstructure and mechanical properties were investigated. The results show that FSP causes a remarkable grain refinement and homogenization, and it makes the coarse, network-like eutectic β-Mg17Al12 phase break up and dissolve into the magnesium matrix. There is no obvious preferential orientation in the cast AZ31 alloy and the single-pass FSP specimen. On the contrary, the two-pass FSP specimen exhibits the preferential grain orientation, and (0002) basal plane shows a strong tendency to be parallel to the plate surface. Further, the ultimate tensile strengths of the single-pass and the two-pass FSP specimens increase by 43 and 82 MPa, and elongations increase by 4.3% and 11.9%, respectively. In the FSP condition, the fracture surface of the AZ31 magnesium alloy exhibits ductile fracture characterization.