When enough people take pills to protect themselves from HIV, they also help control its spread, researchers reported Wednesday.

Pills that treat HIV infection can also prevent infection if people at high risk take them. The approach is called pre-exposure prophylaxis or PrEP, and it’s more than 99 percent effective in preventing infection if people take the pills every day.

If enough people take PrEP, that should slow the spread of HIV and a team of researchers in Australia say it happened there. When they dispensed PrEP to 3,600 men at high risk of HIV for a year, and made sure they took the pills, the spread of HIV across the whole state fell by 25 percent between 2016 and 2017.

It's another piece of evidence supporting the use of PrEP, but statistics show barely anyone who should be getting the treatment actually does.

“We recruited high-risk gay men in a New South Wales-wide network of 21 clinics,” Andrew Grulich of the University of New South Wales and colleagues wrote in a report published in the Lancet HIV. “PrEP implementation was associated with a rapid decline in HIV diagnoses in the state of New South Wales.”

It was a highly coordinated campaign to test gay and bisexual men, who are at a higher risk of catching HIV, and then follow up with them to make sure they got the pills and took them. It was hard work to make everything go right, Grulich said.

“This study involved a large-scale and state-wide response to ensure that PrEP was made available to men at high risk of HIV infection,” he said in a statement.

“This involved leadership from the NSW government, advocacy groups working to help improve health literacy, and a network of free, publicly funded and private sexual health services serving men who have sex with men.”

Over the year, just two of the men who were given PrEP caught HIV, and neither of them had taken the pills they were given as suggested, the researchers reported.

Gilead's two-drug pill Truvada has been approved for use as a PrEP drug.

Many governments and non-profit groups are trying to make PrEP more widely available to people at high risk of HIV, but their success is hit and miss. In the U.S., for example, researchers have estimated that 1.1 million people should be taking PrEP.

But a CDC study out Thursday showed that only 78,000 Americans are actually taking it.

"Approximately 7 percent of the estimated 1.1 million persons who had indications for PrEP were prescribed PrEP in 2016, including 2.1 percent of women with PrEP indications," the CDC reported.

Minorities are also missing out.

"Although black men and women accounted for approximately 40 percent of persons with PrEP indications, this study found that nearly six times as many white men and women were prescribed PrEP as were black men and women," the CDC team reported.

“One of our most powerful tools for HIV prevention remains largely on pharmacy shelves,” Dr. Jonathan Mermin, director of CDC’s National Center for HIV/AIDS, Viral Hepatitis, STD, and TB Prevention, said in a statement.

All governments with populations at risk of HIV should be using PrEP, said Sheena McCormack, of Britain’s Medical Research Council Clinical Trials Unit, who was not involved in the study.

“New South Wales has shown how effective the combined efforts of government leadership, civil society, and a state-wide sexual health service can be at achieving high coverage with a new technology. Others need to follow suit,” she wrote in a commentary.

McCormack noted that in the Australian study, it was easier to get men treated when there were high concentrations of gay and bisexual men. “The reduction in recent HIV infections exceeded 50 percent in Sydney’s gay suburbs and the rest of New South Wales, but was only 7.3 percent in the non-gay suburbs of the city, highlighting the challenge of reaching all communities,” she wrote.

“Nonetheless, the overall benefit from the introduction of PrEP was impressive, given the evidence from behavior surveys and notifications of sexually transmitted infections suggesting that risk was increasing during this period.”

And in many places, especially Africa but also parts of the U.S., heterosexual women are at a high risk, also. In some cities and in Eastern Europe, injecting drug users have a high risk of HIV.

According to the United Nations, nearly 37 million people are infected with the human immunodeficiency virus that causes AIDS. More than 35 million people have died from AIDS-related illnesses.

The virus infects 1.8 million people each year. There is no cure and no vaccine, but the antiviral drugs can keep the infection under control and keep people healthy.