The induction of the hermaphrodite vulva and the migration of the sex myoblasts in the nematode Caenorhabditis elegans are both controlled by intercellular signalling. The gonadal anchor cell induces formation of the vulva from nearby hypodermal cells, and a set of somatic gonadal cells attract the migrating sex myoblasts to their final positions. Many genes required for vulval induction have been identified, including the let-23 receptor tyrosine kinase gene and the let-60 ras gene. We report here the identification and characterization of a new gene, sem-5 (sem, sex muscle abnormal), that acts both in vulval induction and in sex myoblast migration. On the basis of its DNA sequence, sem-5 encodes a novel 228-amino-acid protein which consists almost entirely of one SH2 (SH, src homology region) and two SH3 domains. SH2 and SH3 domains are present in many signalling proteins regulated by receptor and non-receptor tyrosine kinases. Mutations that impair sem-5 activity alter residues that are highly conserved among different SH2 and SH3 domains. Our results indicate that the sem-5 gene encodes a novel protein that functions in at least two distinct cell-signalling processes.