Tony Cenicola/The New York Times

Morning pick-me-up? For many women, the mood-elevating effects of a cup of coffee may be more than fleeting.

A new study shows that women who regularly drink coffee — the fully caffeinated kind — have a 20 percent lower risk of depression than nondrinkers. Decaf, soft drinks, chocolate, tea and other sources of caffeine did not offer the same protection against depression, possibly because of their lower levels of caffeine, the authors say.

Dr. Albert Ascherio, an author of the study and professor of epidemiology and nutrition at the Harvard School of Public Health, said it was too early to recommend that women load up on extra lattes. More research is needed, he said, and “a very high level of caffeine can increase anxiety” and insomnia, potentially reversing any mood-lifting effects.

A link between caffeine intake and depression had been suspected for years. Previous research reported that the risk of suicide decreases with increasing coffee consumption. And a study of over 2,200 middle-aged men in Finland found that heavy coffee drinkers had a significantly lower risk of severe depression than men who avoided coffee, though the sample size was considered too small to be very definitive.

The new study, published in the latest issue of The Archives of Internal Medicine, was larger and more rigorous, analyzing data on nearly 51,000 women taking part in the famous Nurses’ Health Study. Between 1996 and 2006, the women provided detailed information every two years on their caffeine intake, depression risk factors and overall health, including their weight, their use of hormones and their levels of exercise and smoking. Women who reported a diagnosis of depression or showed signs of it at the start of the study were excluded from the analysis.

During the decade that the women were followed, 2,607 cases of clinical depression were diagnosed. Over all, women who regularly drank coffee had a lower risk of depression — about 20 percent — than the women who abstained, and the risk was dose-dependent. In other words, the likelihood of depression fell with each additional cup of coffee, in this case up to as many as six cups a day.

When soda, herbal teas and other sources of caffeine were taken into account, the relationship did not hold up. “The other sources were so minimal,” said Dr. Ascherio. “Nobody would get the equivalent of four cups of coffee by drinking tea or caffeinated drinks.”

The researchers aren’t sure why caffeine might keep depression at bay. “We know that caffeine enters the brain and activates the release of different neurotransmitters that are related to mood, like dopamine and serotonin,” Dr. Ascherio said. “That may explain the shorter-term effects on mood. But the long-term mechanisms of caffeine intake on mood we don’t really know.”

He also noted earlier research showing that coffee can have a protective effect against Parkinson’s disease and other neurodegenerative disorders in which symptoms of depression are common, suggesting that “caffeine may have some beneficial effect on neuronal health,” he said.

Dr. Ascherio is looking to examine in another large study whether other factors, like genetics, may play a role. “We want to see if there are different effects in people with different genotypes that could affect the metabolism of caffeine or that predispose to depression,” he said.

In an editor’s note that accompanied the study, Dr. Seth A. Berkowitz called the research “an important contribution because it is, to my knowledge, the first large-scale study of coffee consumption to evaluate a mental health outcome in women.” He added that “it seems premature to recommend coffee consumption until studies with methodologies better able to determine causality are conducted.”

The latest study looked only at women drinking as much as four to six cups of coffee a day, and not women drinking greater amounts. But earlier research on caffeine and suicide risk found that risk of suicide decreased progressively up to six or seven cups a day, then increased after eight or more cups a day.

“Some people may think ‘a bit is good, so more is better,’ but that’s not true,” Dr. Ascherio said. “We self-medicate ourselves with caffeine, and each person usually knows their optimal level.”