Using a new technique to peer into the brains of mice, US scientists witnessed the rapid growth of structures linking memory, drug experience and behaviour.
They say the findings shed light on the way drug dependency can take over people's lives.
Within two hours of being injected with cocaine, the mice brains started sprouting dendritic spines, twig-like structures that connect neurons. The "fast and robust" growth occurred in the frontal cortex, which controls higher functions such as decision-making. It coincided with a dramatic change in the rodents' behaviour. Given the choice of two environments, mice switched preferences to the one where they had received the cocaine.
"This gives us a possible mechanism for how drug use fuels further drug-seeking behaviour," said Dr Linda Wilbrecht, who led the research at the University of California at San Francisco.
"It's been observed that long-term drug users show decreased function in the frontal cortex in connection with mundane tasks, and increased function in response to drug-related activity or information."
Neurons affected by cocaine had the "potential to bias decision-making", she added.