Previously, it was shown that type IVB pili encoded by the Salmonella enterica serovar Typhi pil operon are used to facilitate bacterial entry into human intestinal epithelial cells in vitro and that such entry is inhibited by purified prepilin (pre-PilS) protein (X.-L. Zhang, I. S. M. Tsui, C. M. C. Yip, A. W. Y. Fung, D. K.-H. Wong, X. Dai, Y. Yang, J. Hackett, and C. Morris, Infect. Immun. 68:3067-3073, 2000). The pil operon concludes with a simple shufflon, and a recombinase gene product (Rci) inverts DNA in the C-terminal region of the pilV gene to allow synthesis of two distinct PilV proteins, PilV1 and PilV2, which are presumptive minor pilus proteins. We show here that the type IVB pili mediate bacterial self-association, but only when the PilV1 and PilV2 proteins are not expressed. This may be achieved in wild-type serovar Typhi by rapid DNA inversion activity of the shufflon. We show that the inversion activity inhibits the expression of genes inserted between the 19-bp inverted repeats used for Rci-mediated recombination and that the activity of Rci increases when DNA is supercoiled. The data suggest that serovar Typhi self-associates under conditions (such as low oxygen tension in the gut) that favor DNA supercoiling. These results explain (i) the function of the serovar Typhi shufflon and (ii) why there are only two possible shufflon states, in contrast to the many possible states of other shufflon systems. The data further indicate that a very early step in serovar Typhi pathogenesis may be type IVB pilus-mediated self-association of bacteria in the anaerobic human small intestine prior to invasion of the human gut epithelium. The suggested type IVB pilus-dependent step in typhoid fever pathogenesis may partially explain the enhanced invasiveness of serovar Typhi for humans.