(CNN) Use of a daily pill to prevent HIV infection rose almost 500% from 2014 to 2017, according to new research published Thursday by the US Centers for Disease Control and Prevention. More than a third of people at risk of HIV infection are now protected with the medication, which is more than 90% effective, according to the CDC.

Almost all demographic groups reported increased use of the pill, called pre-exposure prophylaxis, or PrEP. But use remained low in black, Hispanic and Latino men who have sex with men. Those groups are at particular risk for HIV infection, according to the CDC , and accounted for about 40% of all HIV infections in 2017, the last year for which data is available.

Among men who have sex with men, 42% of white men reported using the drug, while just 26% of black men reported the same. Researchers noted that there are "structural barriers associated with race that influence access to high quality care" and recommended targeted efforts to increase PrEP use among minorities.

The study was conducted in 20 urban areas and surveyed more than 4,000 HIV-negative men who reported having sex with men. In 2014, just 6% of those at risk were on the pill, but that number rose to 35% in 2017, researchers found. Awareness of the drug increased as well, from 60% to 90% over three years.

One of the biggest barriers to access may be the drug's cost. In the United States, PrEP costs about $1,800 a month for those without insurance. In countries such as South Africa and Kenya, it costs only about $75 per year , according to the Joint United Nations Programme on HIV/AIDS.

Read More