Fly ash geopolymer concrete (FAGC) and ordinary Portland cement concrete (OPCC) specimens were immersed in 5% MgSO4solution undergoing 32 wetting-drying and heating-cooling cycles. Their compressive behavior was investigated after every 8 cycles. Several microstructure analysis techniques were applied on the samples to identify the materials formed due to magnesium sulfate attack, including XRD, FTIR, SEM, and EDS. Experimental results elucidated that the compressive strength loss ratio in the heating group of FAGC was 12.7%, while that of OPCC was 17.8%, which means that FAGC had better magnesium sulfate resistance than OPCC. The compressive strength loss of OPCC was due to the formation of gypsum under the magnesium sulfate attack exposed to wetting-drying and heating-cooling cycles. The deterioration mechanisms of FAGC against MgSO4solution were discovered to be that sodium aluminum silicate hydrate (N-A-S-H) gels reacted with MgSO4, leading to the creation of low strength magnesium aluminum silicate hydrate (M-A-S-H) gels.