Dislocations in two heat-resistant Mg alloys, Mg_（97）Zn_1Y_2 and Mg_（97）Zn_1Gd_2（at.%）, were studied using aberration-corrected Z-contrast imaging techniques. Dissociation of basal 〈a〉 dislocations and associated segregation of solute atoms produced local structures like long-periodic stacking ordered phases at tilt GBs formed during plastic deformation, which may play an important role in both pinning the GBs and preventing them from softening at elevated temperatures. GBs composed of 〈c＋a〉 dislocations were formed due to the activation of pyramidal slip systems with increasing plastic strain. Pyramidal slip of 〈c＋a〉 dislocations is important for ductility of Mg alloys. Solute segregation along dislocations in the form of Cottrell atmospheres during hot deformation, not only plays an important role in strengthening by directly impeding dislocation motion, but also facilitates heterogeneous nucleation and growth of strengthening precipitates. These findings about dislocations provide insights on the strengthening and toughening mechanisms in Mg alloys.