They found that when these molecules are broken into fragments, as they might be when the fish’s skin is injured, and added to water, they prompt alarm behavior in other fish. At low concentrations, the fish were “mildly perturbed,” Dr. Jesuthasan said. At high concentrations, they stopped darting altogether and froze in place for an hour or longer.

He and his colleagues also showed that neurons in the olfactory bulb of these fish were activated when exposed to the sugar fragments. In a sense, the fish seemed to “smell” the injury.

The work could have broad implications for understanding fear and panic in other animals, and perhaps in humans, said Lisa Stowers, a neuroscientist at the Scripps Research Institute who was not involved in the research. Researchers have long struggled for better ways to help patients who are chronically prone to panic or anxiety.

Fear can be a useful tool for an individual animal. But it’s even more useful for one animal to be able to communicate its alarm — quickly — to others of its kind. Many lower animals seem to rely on smell to accomplish this, but surprisingly little is known of the substances used, or how they are produced or perceived.

The best-known alarm signals are used by bees and ants. The European honeybee releases a mixture of compounds after a sting. A major component is a molecule called isopentyl acetate, which rouses alarm in other honeybees. “Carpenter ants release compounds called formic acid and n-undecane to signal danger to their fellows,” Dr. Jesuthasan said. “Ants that sense these chemicals stop moving, swing their antennae and then begin moving quickly. If an enemy is spotted, they become aggressive. The exact response depends on the ratio of the chemicals.”