In this paper we have calculated the effect of Lyalpha photons emitted by the first stars on the evolution of the IGM temperature. We have considered both a standard Salpeter IMF and a delta-function IMF for very massive stars with mass 300 M_sun. We find that the Lyalpha photons produced by the stellar populations considered here are able to heat the IGM at z<25, although never above ~100 K. Stars with a Salpeter IMF are more effective as, due to the contribution from small-mass long-living stars, they produce a higher Lyalpha background. Lyalpha heating can affect the subsequent formation of small mass objects by producing an entropy floor that may limit the amount of gas able to collapse and reduce the gas clumping.We find that the gas fraction in halos of mass below ~ 5 x 10^6 M_sun is less than 50% (for the smallest masses this fraction drops to 1% or less) compared to a case without Lyalpha heating. Finally, Lyalpha photons heat the IGM temperature above the CMB temperature and render the 21cm line from neutral hydrogen visible in emission at z<15.