An increasing number of outbreaks of gastroenteritis recently caused by Escherichia coli O157:H7 have been linked to the consumption of leafy green vegetables. Although it is known that E. coli survives and grows in the phyllosphere of lettuce plants, the molecular mechanisms by which this bacterium associates with plants are largely unknown. The goal of this study was to identify E. coli genes relevant to its interaction, survival, or attachment to lettuce leaf surfaces, comparing E. coli K-12, a model system, and E. coli O157:H7, a pathogen associated with a large number of outbreaks. Using microarrays, we found that upon interaction with intact leaves, 10.1% and 8.7% of the 3,798 shared genes were differentially expressed in K-12 and O157:H7, respectively, whereas 3.1% changed transcript levels in both. The largest group of genes downregulated consisted of those involved in energy metabolism, including tnaA (33-fold change), encoding a tryptophanase that converts tryptophan into indole. Genes involved in biofilm modulation (bhsA and ybiM) and curli production (csgA and csgB) were significantly upregulated in E. coli K-12 and O157:H7. Both csgA and bhsA (ycfR) mutants were impaired in the long-term colonization of the leaf surface, but only csgA mutants had diminished ability in short-term attachment experiments. Our data suggested that the interaction of E. coli K-12 and O157:H7 with undamaged lettuce leaves likely is initiated via attachment to the leaf surface using curli fibers, a downward shift in their metabolism, and the suppression of biofilm formation.