All animals exhibit innate behaviors that are specified during their development. Drosophila melanogaster males (but not females) perform an elaborate and innate courtship ritual directed toward females (but not males). Male courtship requires products of the fruitless (fru) gene, which is spliced differently in males and females. We have generated alleles of fru that are constitutively spliced in either the male or the female mode. We show that male splicing is essential for male courtship behavior and sexual orientation. More importantly, male splicing is also sufficient to generate male behavior in otherwise normal females. These females direct their courtship toward other females (or males engineered to produce female pheromones). The splicing of a single neuronal gene thus specifies essentially all aspects of a complex innate behavior.