In this work, the friction stir welded AZ31 joint was processed by a two-step post-weld deformation (i.e. compression at room temperature and an elevated temperature, respectively). The microstructure, texture and mechanical properties were systematically investigated. Profuse extension twins were observed after the first-step cold compression along normal direction, which largely affected the dynamic recrystallisation process during the second-step hot compression. Finally, the grain orientations and their convergence on the weld side were effectively altered, thereby contributing substantially to the enhancement of joint performance. Compared to the original joint, the yield strength, ultimate tensile strength and elongation were improved 64.7%, 20.8% and 52.5%, respectively. The underline strengthening mechanism was discussed by a comprehensive analysis of Schmid factor and geometric compatibility factor.