One day in a lab, scientists gave MDMA to four octopuses. Do not try this at home.

After putting the eight-legged sea creatures in beakers filled with dissolved ecstasy, scientists learned that the octopuses, known for their anti-social behavior, become more touchy-feely. This reaction suggests an evolutionary link between humans and octopuses through their social behavior, the scientists said.

They reported their findings Thursday in Current Biology.

Octopus intelligence rivals many mammals, and octopuses are the most behaviorally advanced invertebrates. Octopuses can complete mazes and escape from aquariums, but scientists previously believed that these cephalopods lack the social behaviors that often come in species with greater smarts.

But the new study shows octopuses can exhibit similar social behaviors as humans with a little push from ecstasy, despite drastic differences in their brains. If combined in the future with gene sequencing, the research may reveal the evolution of social behavior across species.

Humans and octopuses diverged evolutionarily 500 million years ago, and a lot has changed since. Besides the obvious additional limbs, or tentacles, lack of spine and affinity for water, octopuses have vastly different central nervous systems compared to humans. For one, octopuses grow most their nerve cells (neurons) in their arms, and as a result, can taste and touch things without their brains being involved.

Then in 2015, marine biologist Eric Edsinger co-discovered a surprising genetic connection between octopuses and humans. Genetic sequencing revealed that octopuses and humans share a nearly identical serotonin transporter, a protein that moves the chemical messenger serotonin between neurons.

Serotonin transporters also mediate the psychological changes associated with taking ecstasy.

“We were interested in the serotonin transporter because we knew that [it was] the principle binding site of MDMA,” said Gul Dolen, a neuroscientist at Johns Hopkins University who co-authored today’s study with Edsinger. “If we focused in on the parts of the protein that are really important for serotonin binding, then the similarity [between humans and octopuses] was over 95 percent.”

Dolen and Edsinger, who works at the Marine Biological Laboratory in Massachusetts, designed a simple experiment. They gathered nine octopuses of the species Octopus bimaculoides, exposed four of the invertebrates to MDMA and watched if they became more social. They compared the behaviors of these drugged subjects to five sober octopuses.

In the wild, Octopus bimaculoides is only friendly for brief periods of time while mating. Unlike humans, lab mice and other mammals, octopuses lack a nucleus accumbens, any folded cortex whatsoever and reward circuits — parts of the brain associated with behavioral changes from drug use.

Molly seemed to change their behavior during testing. When a tripped-out octopus interacted with its caged counterpart, its caresses appeared to be more exploratory rather than aggressive. This observation mirrors the human behavior of becoming more social and touchy-feely after taking ecstasy.

The cephalopods’ unexpected reactions to the drug shocked scientists, who didn’t expect such a shift in behavior.

“I found it incredibly fascinating. It fits in very nicely with a growing idea that there are lots of genetic mechanisms for social behaviors that are conserved across the animal kingdom,” said Robert Meisel, a neuroscientist at the University of Minnesota who was not involved with the study. “You will have animals that tend to live in isolation, and by something so simple as altering a chemical in the nervous system, you can change the behavior.”