Proline and quaternary ammonium compounds (QAC), in addition to being N-rich, are known to accumulate in plants under different environmental stress conditions. The accumulation of N-rich compounds in plants has been shown to confer stress resistance. The aim of our work is two-fold: first, to study the influence of temperature on proline, QAC, and choline metabolism in tomato leaves; and second, to investigate the relationship between N source applied (NO3- or NH4+) and thermal stress resistance in these plants. To do this, experiments were conducted at three different temperatures (10 degrees C, 25 degrees C, 35 degrees C); at each temperature half of the plants received NO3-, and the other half received NH4+. At 35 degrees C the plants had the lowest biomass production with respect to 25 degrees C (optimal temperature) and 10 degrees C (cold stress), suggesting that tomato plants were most affected by heat stress. At 35 degrees C, there were also high levels of choline and proline due to the activation of Delta1-pyrroline-5-carboxylate synthetase (P5CS) and ornithine aminotransferase (OAT), and simultaneous inhibition of proline dehydrogenase (PDH) and proline oxidase (PO). However, plants with NH4+ as the N source exhibited reduced growth with respect to the plants fed with NO3-. This is interesting because, under heat stress (35 degrees C), biomass production, as well as proline and choline accumulation, in NH4+ fed plants was higher than in NO3- fed plants. From this, we concluded that tomato plants fed with NH4+ as the N source show higher tolerance to heat stress (35 degrees C) than plants fed with NO3-.