Swarming is a specialized form of surface motility displayed by several flagellated bacterial genera, which shares features with other surface phenomenon such as biofilm formation and host invasion. Swarmer cells are generally more flagellated and longer than vegetative cells of the same species propagated in liquid media, and move within an encasement of polysaccharide 'slime'. Signals and signalling pathways controlling swarm cell differentiation are largely unknown. In order to test whether there is a genetic programme specific to swarming, we have determined global gene expression profiles of Salmonella typhimurium over an 8 h time course during swarming, and compared the microarray data with a similar time course of growth in liquid media as well as on harder agar where the bacteria do not swarm. Our data show that bacteria growing on the surface of agar have a markedly different physiology from those in broth, as judged by differential regulation of nearly one-third of the functional genome. The large number of genes showing surface-specific upregulation included those for lipopolysaccharide synthesis, iron metabolism and type III secretion. Although swarming-specific induction of flagellar gene expression was not generally apparent, genes for iron metabolism were strongly induced specifically on swarm agar. Surface-dependent regulation of many virulence genes suggests that growth on an agar surface could serve as a model for gene expression during the initial stages of host infection. Based on cluster analysis of distinctive expression patterns, we report here the identification of putative new genes involved in motility and virulence.