Growing a human being is no small feat—just ask any newly pregnant woman. Her hormones surge as her body undergoes a massive physical transformation, and the changes don’t end there. A study published Monday in Nature Neuroscience reveals that during pregnancy women undergo significant brain remodeling that persists for at least two years after birth. The study also offers preliminary evidence that this remodeling may play a role in helping women transition into motherhood.

A research team at Autonomous University of Barcelona, led by neuroscientist Elseline Hoekzema of Leiden University, performed brain scans on first-time mothers before and after pregnancy and found significant gray matter changes in brain regions associated with social cognition and theory of mind—the same regions that were activated when women looked at photos of their infants. These changes, which were still present two years after birth, predicted women’s scores on a test of maternal attachment, and were so clear that a computer algorithm could use them to identify which women had been pregnant.

One of the hallmarks of pregnancy is an enormous increase in sex steroid hormones such as progesterone and estrogen, which help a woman’s body prepare for carrying a child. There is only one other time when our bodies produce similarly large quantities of these hormones: puberty. Previous research has shown that during puberty these hormones cause dramatic structural and organizational changes in the brain. Throughout adolescence both boys and girls lose gray matter as the brain connections they don’t need are pruned, and their brains are sculpted into their adult form. Very little research has focused on anatomical brain changes during pregnancy, however. “Most women undergo pregnancy at some point in their lives,” Hoekzema says, “But we have no idea what happens in the brain.”

Hoekzema and her colleagues performed detailed anatomical brain scans on a group of women who were trying to get pregnant for the first time. The 25 women who got pregnant were rescanned soon after they gave birth; 11 of them were scanned two years after that. (For comparison, the researchers also scanned men and women who were not trying to have a child as well as first-time fathers). During the postpartum period, the researchers also performed brain scans on the new mothers while they looked at photos of their infants. The scientists used a standard scale to rate the attachment between mother and infant.

The researchers found that the new mothers experienced gray matter reductions that lasted for at least two years after birth. This loss, however, is not necessarily a bad thing (according to Hoekzema, “the localization was quite remarkable”); it occurred in brain regions involved in social cognition, particularly in the network dedicated to theory of mind, which helps us think about what is going on in someone else’s mind—regions that had the strongest response when mothers looked at photos of their infants. These brain changes could also be used to predict how mothers scored on the attachment scale. In fact, researchers were able to use a computer algorithm to identify which women were new mothers based solely on their patterns of gray matter loss. Gray matter loss was not seen in new fathers or nonparents.

It is not entirely clear why women lose gray matter during pregnancy, but Hoekzema thinks it may be because their brains are becoming more specialized in ways that will help them adapt to motherhood and respond to the needs of their babies. The study offers some preliminary evidence to support this idea. Whereas the present study focuses primarily on documenting brain changes during pregnancy, she expects follow-up work to tackle more applied questions such as how brain changes relate to postpartum depression or attachment difficulties between mother and child.

Ronald Dahl, a neuroscientist at the University of California, Berkeley, who was not involved in the work, says he had “a delightful ‘wow’ moment” on seeing the study. “This is a pioneering contribution that not only documents structural brain changes linked to pregnancy but also compellingly offers evidence that suggests these represent adaptive changes,” he wrote in an e-mail.

Mel Rutherford, an evolutionary psychologist at McMaster University in Ontario, is also enthusiastic about the study—which, to his knowledge, is the first that uses neuroimaging to track brain changes during pregnancy. “Probably the most exciting thing is that they were able to follow up two years after the birth of the baby,” he says, “So they have the longest-term evidence that we've seen of changes in the brain after pregnancy.” The results mesh with Rutherford’s own research on cognitive changes during pregnancy, which he approaches from an evolutionary perspective. “As a parent, you're now going to be solving slightly different adaptive problems, slightly different cognitive problems than you did before you had children,” he explains. “You have different priorities, you have different tasks you're going to be doing, and so your brain changes.”