CTXphi is a filamentous phage that encodes cholera toxin, one of the principal virulence factors of Vibrio cholerae. CTXphi is unusual among filamentous phages because it can either replicate as a plasmid or integrate into the V. cholerae chromosome at a specific site. The CTXphi genome has two regions, the 'core' and RS2. Integrated CTXphi is frequently flanked by an element known as RS1 which is related to RS2. The nucleotide sequences of RS2 and RS1 were determined. These related elements contain three nearly identical open reading frames (ORFs), which in RS2 were designated rstR, rstA2 and rstB2. RS1 contains an additional ORF designated rstC. Functional analyses indicate that rstA2 is required for CTXphi replication and rstB2 is required for CTXphi integration. The amino terminus of RstR is similar to the amino termini of other phage-encoded repressors, and RstR represses the expression of rstA2. Although genes with related functions are clustered in the genome of CTXphi in a way similar to those for other filamentous phages, the CTXphi RS2-encoded gene products mediating replication, integration and repression appear to be novel.