It is a time of sleep deprivation, constant tiredness and a regular inability to carry out even the simplest task. But now scientists have discovered - after experimenting on the California deer mouse, laboratory rats, and humans - that pregnancy also confers startling benefits: it actually boosts brainpower.

During pregnancy, learning and memory skills improve dramatically, say researchers, reversing the popular myth that it is a time of dumbing down. Key brain areas also alter in size; changes that can persist for decades. Far from transforming mothers into weakened emotional wrecks who lose car keys and drop in IQ, it turns out having children makes them cleverer. It's just hard to spot thanks to all that lost sleep.

'Many benefits seem to emerge from motherhood, as the maternal brain rises to the reproductive challenge,' says Professor Craig Kinsley, of Richmond University, and Professor Kelly Lambert, of Randolph-Macon College, both in Virginia, writing in the latest Scientific American. 'In other words, when the going gets tough, the brain gets going.'

Their paper reveals that the brain-boosting potential of parenthood includes enhanced sensory abilities just after childbirth, allowing women to recognise their infants by faint smells and sounds. It also reports that women who have children in their forties are four times more likely to survive to 100 than women who gave birth earlier. Pregnancy enhances women's brains just when the memory decline of middle age normally kicks in, say researchers, leading to better mental health and longevity.

Underlying these changes are two key processes. The first involves the hormonal fluctuations of pregnancy, birth and lactation, which remodel the brain, increasing the size of neurons in some regions. Women become vigilant and alert - and the benefits appear to be long-lasting, say Kinsley and Lambert.

Secondly, rearing a child is so challenging it stimulates brain activity. Having a baby is 'a revolution for the brain', says Dr Michael Merzenich of the University of California in San Francisco. The brain creates cells that thrive the more they are used and the emotional, novel experiences of childraising provide the most stimulating use of all.

Further support for this idea is provided by Katherine Ellison in her book, The Mommy Brain, published last year in the United States and scheduled for release in the UK in April. As Ellison points out: 'There's no other time in a woman's life when she needs to be quite as smart as when she is looking after young children.'

In other words, getting a cerebral lift in pregnancy makes evolutionary sense and evidence can be seen throughout the animal kingdom, Lambert told The Observer. 'We just didn't look for the evidence before,' she said.

In one experiment, scientists compared the behaviour of virgin female rats with those with litters. The rats were placed in enclosures containing a cricket - a tasty rat snack - hidden under wood chips. 'The virgins took nearly 270 seconds to find the cricket and eat it, compared with slightly more than 50 seconds for mother rats,' Lambert said.

Kinsley and Lambert say the phenomenon could have been a key driver in the evolution of all mammals. Instead of laying eggs and walking off like reptiles, mammals defend their young. Creatures that were most vigilant at this time would have fared better and lived longer.

The idea may seem startling because a dimming of brain power is still viewed as a side effect of motherhood. 'It does seem counter-intuitive,' added Lambert. 'We just haven't noticed it because these boosts are masked by sleep deprivation. It wasn't until I had a baby that I realised what is involved in having a child and how organised a female has to be. It makes sense for her body to boost her mental capacities.'

But if mothers get a boost from parenthood, is the same true for fathers? Lambert says yes, but to a more limited extent. 'A man won't get a hormone boost, but if he is an involved father he will gain through sharing the challenging experience of childraising.'

This idea is backed by Lambert's studies of the California deer mouse, the male of which shares equally in childrearing tasks. Experienced fathers were found to do better than inexperienced males in experiments that tested their ability to navigate mazes and find food.

I'm more alert mentally now'

Aine Ropke was born on 26 September to Polly Thompson and Stuart Ropke. 'In the months leading up to Aine's birth, I had been doing some serious multi-tasking,' said Polly. I was juggling the major renovation of our house while getting everything ready for the baby's arrival - which is a big deal when it's your first. At the same time I started a new, stressful and demanding job.

When I gave birth, however, I thought my brain had turned to mush. I was enormously happy, but at the same time I was exhausted and distracted. As the tiredness and stress dropped away, the mists in my head began to clear. Suddenly everything became sharper again and instead of being unable to remember anything, I was plotting, planning and organising just as efficiently as I did before. I think I'm even more mentally alert now than before Aine arrived, because I have to be.'