This paper presents an investigation on durability of alkali-activated slag mortar against magnesium sulfate attack. To do so, the immersion tests in 5% magnesium sulfate solution under room temperature and wetting-drying cycles were applied. Mortar specimens from Portland cements type 2 and 5 in accordance to ASTM standard were also prepared and used as reference. The changes in compressive strength and length of specimens were measured at different time intervals and considered for evaluating the extent of degradation. After 360 days of exposure to the magnesium sulfate solution, type 2 and 5 Portland cements and alkali-activated slag cement have shown 61, 41 and 34% reduction in compressive strength and 0.093, 0.057 and 0.021% increase in length, respectively. The specimens were also studied by X-ray diffractometry and scanning electron microscopy for characterizing the chemical products of the degradation process. Main degradation products were ettringite and gypsum for Portland cements and gypsum for alkali-activated slag cement. According to the obtained results, alkali-activated slag cement exhibits a higher sulfate resistance compared to type 2 and even type 5 Portland cements