The anisotropic mechanical behavior of extruded AZ31 magnesium alloy is described in relation to the crystallographic texture. Specimens taken at 0°, 45° and 90° to the extrusion direction were uniaxially loaded in tension and compression, and the texture evolution was measured under load, using synchrotron radiation. The correlation between the initial texture, the mechanical anisotropy and the activation of different deformation modes was interpreted using the in situ texture measurements and viscoplastic self-consistent simulation results. The activity of the basal slip and the tensile twinning exert a significant effect on the mechanical anisotropy during tension, while the importance of the slip increases during compression.