In the late 1980s, scientists at Osaka University in Japan noticed unusual repeated DNA sequences next to a gene they were studying in a common bacterium. They mentioned them in the final paragraph of a paper: “The biological significance of these sequences is not known.”

Now their significance is known, and it has set off a scientific frenzy.

The sequences, it turns out, are part of a sophisticated immune system that bacteria use to fight viruses. And that system, whose very existence was unknown until about seven years ago, may provide scientists with unprecedented power to rewrite the code of life.

In the past year or so, researchers have discovered that the bacterial system can be harnessed to make precise changes to the DNA of humans, as well as other animals and plants.

This means a genome can be edited, much as a writer might change words or fix spelling errors. It allows “customizing the genome of any cell or any species at will,” said Charles Gersbach, an assistant professor of biomedical engineering at Duke University.