A small survey of young black men from the South who tested positive for H.I.V. in their teens and early 20s found that most had engaged in risky sexual behaviors but thought it unlikely they would be infected, according to the federal Centers for Disease Control and Prevention.

More than half of the 29 gay or bisexual men surveyed said they had engaged in unprotected anal sex in the year before they were infected and had had sex with slightly older men, the survey found. Both are risky behaviors, yet the vast majority of the young men said they had not thought that they would ever be infected.

Young black gay and bisexual men are becoming infected with H.I.V. at alarming rates, particularly in the South, and health officials are trying to analyze their risk factors in order to refine education and intervention strategies.

“We need to make sure that H.I.V. infection does not become a rite of passage for young black men who have sex with men,” said Dr. Alexandra Oster, one of the authors of the survey published last week in the agency’s Morbidity and Mortality Weekly Report.