A team of researchers successfully changed the gender in the brains of newborn rats from female to male, according to findings published this week in Nature Neuroscience.

“Physically, these animals were females, but in their reproductive behavior, they were males,” Bridget Nugent, the lead author said in a press release. “It was fascinating to see this transformation.”

For the study, groups of female rats were injected with DNA methyltransferase (DNMT) inhibitors ten days after birth.

The inhibitors mimicked the masculinizing effects of estradiol, a steroid commonly used in humans to treat the effects of menopause, and one that surges in the brain during prenatal development in male rats.

The goal of the experiment was to show that in order to preserve a female brain in the animal, high levels of DNMT needed to be sustained.

Scientists introduced the inhibitors into the preoptic area of the brain, known to play a major role in shaping male sexual behavior in most species, including humans.

The injections resulted in rats with female physical traits behaving like male rats.

The animals’ behavior was recorded and evaluated by the researchers, who did not know whether each rat was male or female.

Nugent remembered noticing that there were many more rats behaving in a male sexual manner than were not. “It was pretty remarkable,” she said in an email to PBS NewsHour.

Rats typically experience sexual differentiation in the brain between the 18th day of prenatal development and just over a week after being born. Similarly, the fetal brains of humans develop in the male or female direction during the second half of pregnancy.

“It was thought that once established, sexual differentiation could not be undone,” Nugent said. “Our work shows that sex differences in brain and behavior are epigenetically regulated, meaning that sex differences are not hardwired in our DNA but programmed during development.”

Nugent began studying the neuroscience of sex differences in 2008 with Margaret McCarthy, chairman of the Department of Pharmacology at the University of Maryland School of Medicine, which collaborated with the Mt. Sinai School of Medicine in New York on this study.

Currently, Nugent is at the University of Pennsylvania investigating the different ways prenatal stress affects male and female brains.