Somatic sexual differentiation in Drosophila melanogaster involves a cascade of regulated splicing events and provides an attractive model system for the analysis of alternative splicing mechanisms. The protein Sex-lethal (Sxl) activates a female-specific 3' splice site in the first intron of transformer (tra) pre-mRNA while repressing an alternative non-sex-specific site. We have developed an in vitro system that recapitulates this regulation in a manner consistent with genetic, transfection and fly transformation studies. Using this system, we have determined the molecular basis of the splice site switch. Here we show that Sxl inhibits splicing to the non-sex-specific (default) site by specifically binding to its polypyrimidine tract, blocking the binding of the essential splicing factor U2AF. This enables U2AF to activate the lower-affinity female-specific site. A splicing 'effector' domain present in U2AF but absent from Sxl accounts for the different activities of these two polypyrimidine-tract-binding proteins: addition of the U2AF effector domain to Sxl converts it from a splicing repressor to an activator and renders it unable to mediate splice-site switching.