Scientists seeking a cure for AIDS say they have been inspired, not crushed, by a major setback in which two HIV-positive patients believed to have been cured found the virus re-invading their bodies.

True, the news hit hard last month that the so-called “Boston patients” — two men who received bone marrow transplants that appeared to rid them completely of the AIDS-causing virus — had relapsed and gone back onto antiretroviral treatment.

But experts say the disappointment could lay the basis for important leaps forward in the search for a cure.

“It’s a setback for the patients, of course, but . . . the field has now gained a lot more knowledge,” said Steven Deeks, a professor and HIV expert at the University of California at San Francisco.

He and other experts say the primary practical message is that current tests designed to detect even very low levels of HIV in the body are simply not sensitive enough.

As well as having the human immunodeficiency virus (HIV), the Boston patients both also had a type of blood cancer called lymphoma, for which they had bone marrow transplants — one man in 2008 and the other in 2010.

They continued taking antiretroviral AIDS drugs, but eight months after each patient’s transplant, doctors could not detect any sign of HIV in their blood.

In the early part of 2013, both patients decided to stop taking their AIDS drugs and both appeared to remain HIV-free, prompting their doctors at Boston’s Brigham and Women’s Hospital to announce that they may have been cured.

Yet in December came news that one of the men had begun to show signs of an HIV rebound by August, while the second patient had a relapse in November.

One of the doctors, Timothy Henrich, said the virus’s comeback underlined how ingenious HIV can be in finding hiding places in the body to evade attack efforts by the immune system and by drug treatment.

He said both patients were “currently in good health” and back on antiretroviral therapy.

Barely a decade ago, few HIV scientists would have dared put the words “HIV” and “cure” in the same sentence. Yet some recent cases are intriguing.

First was the now famous case of Timothy Ray Brown, the so-called “Berlin patient,” whose HIV was eradicated during treatment for leukemia in 2007 after he received a stem cell transplant from a donor with a rare genetic mutation that resists HIV infection.

Such an expensive and life-threatening procedure could never be used as a broad-spectrum approach for the world’s 34 million HIV patients. But the results focused scientific attention on a genetic mutation known as CCR5 delta 32 as a target for possible gene therapy treatment.

Last March, French scientists reported on 14 HIV-positive people who had been treated very swiftly with HIV drugs but then taken off them. The researchers said that seven years later, the patients were showing no signs of a virus rebound.

Just weeks before that, doctors reported that an HIV-positive baby in Mississippi given antiretroviral treatment for 18 months from the day she was born seemed to have achieved a “functional cure.”