STANFORD — Tiny vials of recently repaired blood cells are thriving in a Stanford incubator, proof that a powerful new gene-editing technique is fixing errant genes that cause so much human suffering.

Until recently, gene therapy was laborious, crude and unsafe for human testing. But the new technology, called CRISPR-Cas9, acts as a microscopic scalpel, performing genomic surgery with a precision, efficiency and affordability once thought unimaginable.

The research being done at the Stanford School of Medicine, led by Dr. Matthew Porteus, is part of an accelerating research movement made possible using the new technique to try to cure genetic diseases such as sickle cell anemia and muscular dystrophy. These labs are steadily advancing through cell-based and animal trials, as fledgling biotech companies raise large sums of money needed to bring the therapies to market.

“Now, with lots of people — hundreds or thousands of labs — working with CRISPR, this means the possibility of actually finding a way to cure patients of disease increases dramatically,” said Porteus, an associate professor of pediatrics and a pioneer in gene editing.

Using the campus’s first-ever cell manufacturing plant, to be completed this spring, the Stanford team aims to start human trials in 2018. The researchers are targeting two severe blood diseases — sickle cell anemia and beta thalassemia — and several diseases that ravage the immune system.

Meanwhile, scientists at Duke University and two other independent labs on Friday announced that they are using the same approach to fix a muscle gene, restoring function in mice with an incurable type of muscular dystrophy. Their findings were published in the journal Science.

Boston researchers are deploying the tool to treat a rare inherited eye disease that can cause blindness. Other teams are working to fix the genes that cause Huntington’s disease, Sanfilippo syndrome and cystic fibrosis.

CRISPR has been in the crosshairs of controversy because of its profound potential to rearrange the basic building blocks of life. In December, experts gathered in Washington, D.C., to urge limits to its use in creating dangerous new organisms or “designer babies.”

But its therapeutic promise is what excites the medical community, especially as the price of the new technology plunges and access expands.

It has buoyed hopes in the beleaguered field of gene therapy, dealt a major setback in 1999 when Jesse Gelsinger, an Arizona teenager with a genetic liver disease, had a fatal reaction to the virus that scientists had used to insert a corrective gene.

These older approaches could not guarantee that the new gene was spliced into the right place. It also risked disruption of adjacent genes.

While there have been recent improvements with two more precise techniques, they are time-consuming and tricky.

CRISPR — which stands for “clustered regularly interspaced short palindromic repeats,” or clusters of brief DNA sequences that read similarly forward and backward — is the game-changer. Only 3 years old, it works like the search-and-replace function of a computer.

A Palo Alto native who was educated at Gunn High School, Harvard and Stanford, Porteus, 51, has spent his lifetime watching helplessly as patients declined from blood and immune system diseases such as sickle cell anemia, beta thalassemia and severe combined immunodeficiency disease.

These are very different diseases, he said. But they have this in common: All are caused by a single mutation in a single gene of a single cell type.

More than 10,000 human diseases are caused by a single gene defect, according to Dr. Maria Grazia Roncarolo, co-director of Stanford’s Institute for Stem Cell Biology and Regenerative Medicine.

Porteus’ lab excises the bad gene, using CRISPR. Then his team introduces a good gene.

The scientists plan to harvest some of the sick cells that give rise to the blood or immune system cells, called stem cells, from the bone marrow of a patient. Then the patient would undergo intensive chemotherapy to kill the remaining sick stem cells and make room for new ones.

After the defective genes in the harvested sick cells are fixed using CRISPR, the repaired cells would incubate for several days.

Finally, they would infuse the corrected stem cells into the patient. Once in place, these stem cells would produce healthy cells to replace the sick cells — so the patient heals.

Not every bad blood cell must be repaired to help a patient, Porteus said.

“It’s like having two broken headlights,” he said. “You can drive a car at night with one headlight. It’s better to have two, but one is sufficient.”

He and his Stanford colleagues have already proven their approach in human cell cultures and in mice. They are refining their technique and now seek to test it in humans. The estimated overall cost could range from $10 million to $17 million, supported by philanthropy and the taxpayer-funded California Institute of Regenerative Medicine.

The gene editing would be performed at the 25,000-square-foot manufacturing facility now under construction on Palo Alto’s California Avenue. To lead the effort, Stanford recently recruited David DiGiusto, director of a successful facility at Southern California’s City of Hope research center and hospital.

Biotech companies are moving into the field, as well. In November, the Cambridge, Massachusetts, biotech startup Editas Medicine, cofounded by the Massachusetts Institute of Technology’s Dr. Feng Zhang, announced that it planned to test a CRISPR-based gene therapy technique in hopes of curing a rare form of blindness by fixing a gene that controls the eye’s photoreceptor cells. It has raised $120 million from investors, including Bill Gates and Google Ventures, on top of $43 million raised in 2013.

In December, the biotech firm CRISPR Therapeutics of Cambridge received an eye-popping $335 million investment from German pharmaceutical giant Bayer AG to form a joint venture that will research CRISPR-based treatments.

More sobering are the challenges posed by many of the world’s more common diseases, such as autism, diabetes, heart disease or cancer, which involve multiple genes. And diseases that involve hard-to-reach tissues, such as Alzheimer’s, are also daunting.

The Stanford strategy is to first focus on a handful of genetic diseases, Porteus said.

“If we prove how to do it, that opens up possibility for many diseases of the immune system and blood system,” he said. “We are working on how to make this pipeline sustainable … needed to develop second-, third-, fourth- and fifth-generation therapies.

“We have all the tools in place.”

Contact Lisa M. Krieger at 650-492-4098. Follow her at Twitter.com/LisaMKrieger and Facebook.com/LisaMKrieger.