The recent observation of the 21-cm global absorption signal by EDGES suggests that the intergalactic medium (IGM) gas has been cooler than the cosmic microwave background during $15 lesssim z lesssim 20$. This result can provide a strong constraint on heating sources for the IGM gas at these redshifts. In this paper we study the constraint on the primordial magnetic fields (PMFs) by the EDGES result. The PMFs can heat the IGM gas through their energy dissipation due to the magnetohydrodynamic effects. By numerically solving the thermal evolution of the IGM gas with the PMFs, we find that the EDGES result gives a stringent limit on the PMFs as $B_{1mathrm{Mpc}} lesssim 10^{-10}$ G.