The structure of the two N-terminal domains of the gene 3 protein of filamentous phages (residues 1-217) has been solved by multiwavelength anomalous diffraction and refined at 1.46 A resolution. Each domain consists of either five or eight beta-strands and a single alpha-helix. Despite missing sequence homology, their cores superimposed with a root-mean-square deviation of 2 A. The domains are engaged in extensive interactions, resulting in a horseshoe shape with aliphatic amino acids and threonines lining the inside, delineating the likely binding site for the F-pilus. The glycine-rich linker connecting the domains is invisible in the otherwise highly ordered structure and may confer flexibility between the domains required during the infection process.