Dramatically fewer black high school students are taking part in sexual behavior that puts them at risk for contracting HIV than they were 20 years ago. However, those students still engage in more risky behavior than their white and Hispanic counterparts.

Meanwhile, teens overall continue to engage in risky behaviors at rates that have declined only slightly over the past two decades, according to an analysis released Tuesday by U.S. government researchers.

More specifically, 46 percent of U.S. high school students in 2011 reported ever having sex, compared to 54 percent in 1991. The percentage of students reporting having had four or more sex partners was 14 percent in 2011, down from 19 percent 20 years earlier. The rates in both categories for Hispanic students barely changed over two decades.

“The overall plateau [among all students] is troubling,” said Laura Kann, senior scientist at the U.S. Centers for Disease Control and Prevention, who released the mixed findings at the International AIDS Conference in Washington.

Four of every 10 new HIV infections occur in people younger than 30, according to the CDC. So reducing risky sexual behavior during teenage years is key. The average age when teens begin to have sex is 16, researchers said.

The findings come from the government’s long-standing survey of high school students’ health, which includes sexual behavior. The data do not include information on family income and education, which are known to influence risky behavior in teenagers. But researchers said one possible reason for the encouraging news about black high school students could be investments in sexual education and HIV prevention efforts in schools.

Black students were the only group to report a steady increase in percentages of youth taking HIV education classes, rising to 87 percent in 2011 from 84 percent in 1991, Kann said.

Overall, the number of U.S. high school students who have been taught about HIV and received sexual education in schools over the past decade has declined steadily due to budget cutbacks.

The data also showed that sexually active black students were the most likely to use a condom in their most recent sexual encounter at 65 percent, but that is a drop from a high of 70 percent in 1999.

Young black men who are gay or bisexual are especially vulnerable and at high risk for HIV and need to be the focus of prevention, said Kevin Fenton, director of CDC’s National Center for HIV/AIDS, Viral Hepatitis, STD and Tuberculosis Prevention. Unless improvements are made, according to research presented Monday, more than half of all black men younger than 30 who are gay or bisexual will be infected with HIV within the next decade.

The research suggests that black youth are benefiting from school-based education about HIV, but once they leave the school environment, gay and bisexual youth enter a high-risk environment where HIV prevalence is high. Having sex with partners who are also black, and older, poses risks and helps spread the virus.

“We are at a pivotal moment in HIV prevention,” Fenton said. There is growing hope of achieving an AIDS-free generation here at home in America, he said, but keeping young people safe is essential to reaching that goal.