The finding supports scientific evidence accumulating over the past decade that sexual orientation may be innately programmed into the brains of men and women. Equally intriguing, the researchers say, is the possibility that a number of behaviors -- hitting back when feeling threatened, fleeing when scared or laughing when amused -- may also be programmed into human brains, a product of genetic heritage.

"This is a first -- a superb demonstration that a single gene can serve as a switch for complex behaviors," said Dr. Gero Miesenboeck, a professor of cell biology at Yale.

Dr. Dickson, the lead author, said he ran into the laboratory when an assistant called him on a Sunday night with the results. "This really makes you think about how much of our behavior, perhaps especially sexual behaviors, has a strong genetic component," he said.

All the researchers cautioned that any of these wired behaviors set by master genes will probably be modified by experience. Though male fruit flies are programmed to pursue females, Dr. Dickson said, those that are frequently rejected over time become less aggressive in their mating behavior.

When a normal male fruit fly is introduced to a virgin female, they almost immediately begin foreplay and then copulate for 20 minutes. In fact, Dr. Dickson and his co-author, Dr. Ebru Demir of the Institute of Molecular Biotechnology, specifically chose to look for the genetic basis of fly sexual behavior precisely because it seemed so strong and instinctive and, therefore, predictable.

Scientists have known for several years that the master sexual gene, known as fru, was central to mating, coordinating a network of neurons that were involved in the male fly's courtship ritual. Last year, Dr. Bruce Baker of Stanford University discovered that the mating circuit controlled by the gene involved 60 nerve cells and that if any of these were damaged or destroyed by the scientists, the animal could not mate properly. Both male and female flies have the same genetic material as well as the neural circuitry required for the mating ritual, but different parts of the genes are turned on in the two sexes. But no one dreamed that simply activating the normally dormant male portion of the gene in a female fly could cause a genetic female to display the whole elaborate panoply of male fruit fly foreplay.