A brain protein switches from "Jekyll to Hyde" - building memories, but also playing a role in killing brain cells in conditions such as dementia.
The researchers took a detailed look at how a protein behaves in the brain
Harvard Medical School researchers say the switch is caused by the brain trying to compensate for the damage done by such conditions.
Writing in Neuron, they said their study of mice could offer clues about what happens in human brains.
Dementia researchers agreed the work could further understanding.
The researchers focused on enzymes in the brain which control its biochemistry.
Abnormal patterns had already been seen in the brains of patients with Alzheimer's disease.
The researchers looked at the influence of a protein called p25 which appears to play a role in triggering these abnormal patterns - in certain circumstances.
In the study, the researchers "switched on" p25 at will in the brain's learning and memory centre, the hippocampus.
In these mice, they found that switching on p25 for only two weeks boosted learning and memory compared to normal mice.
But if the p25 was switched on for six weeks, mice displayed impaired learning and memory in tests.
Physiological studies showed that these mice showed significant brain damage and lost nerve cells in the hippocampus.
But those who had elevated p25 levels for just two weeks had no such effects.
The researchers concluded that short-term production of p25 boosts learning - but long term exposure affects the ability to form new memories.
The researchers, led by Dr Li-Huei Tsai, say the study suggested that the protein was normally beneficial, helping form memories and enable learning.
But if there was too much p25, perhaps because of other changes in the brain linked to dementias, nerve cells can die.
Dr Susanne Sorensen, head of research for the UK's Alzheimer's Society, said: "These research results are interesting and necessary in the quest to understand both how we learn normally and why we lose the ability to lay down new memories as Alzheimer's disease develops.
"This detailed piece of research documents how a biological mechanism that is beneficial to the brain when it is under short term biological stress may cause damage and nerve cell death when kept activated for longer.
"Its results support previous research which has found elevated levels of the changed protein part in brains from people who died from Alzheimer's disease.
"This is a complex process and one that we still know very little about."
She added: "More research needs to be carried out to understand what triggers the adverse changes in this part of the protein, and the role it has in the development of dementia."