In a wide-ranging probe published in The Lancet Global Health, researchers in Britain and South Africa interviewed 3,500 teenagers and followed this up with another interview a year later.
Teenage girls from households which received child support were two-thirds less likely to have a much older boyfriend compared to counterparts from homes that did not receive the benefit, they found.
These girls were also half less likely to have sex in exchange for food, money or school fees.
South Africa has more than one in six of the world's tally of people infected with the AIDS virus.
At the end of 2012, it had 6.1 million people with the human immunodeficiency virus (HIV), of whom 3.4 million were women, according to UN figures.
Half of all new infections were among young people, and girls were two to three times likelier to be infected than boys.
One of the biggest sources of infection are so-called sugar daddies -- older men who give girls money or material benefits in exchange for sex.
These men are far likelier than boys in the girl's age group to have HIV and also likelier to press a girl to have sex without a condom.
"This study shows that as long as they are given enough money to survive, girls will choose not to have a sugar daddy," said Lucie Cluver of the University of Oxford.
"It also shows how valuable it is to give not only to younger children but also to teenagers, who are most at risk of HIV infections."
Child support in South Africa was 280 rands ($35 or 26 euros) per month per household in 2012. It was paid to 11.2 million children under 18 under a means-tested scheme. There is also a foster-child grant of 770 rand, being paid for 573,000 children.
Expansion of these programmes means that support now reaches about 70 percent of eligible children in South Africa, according to the probe.
With 100-percent coverage, 77,000 new relationships between girls aged 12-18 and "sugar daddies" could be prevented each year, it estimated.
Two smaller studies in sub-Saharan Africa have previously provided evidence that cash transfers, focused on poor youngsters, can be useful weapons in the fight against HIV.
One was in Malawi, involving a pilot trial that involved small cash payments to girls; the other was in Tanzania, where money was given every quarter on condition that the girl returned a negative result in tests for sexually-transmitted disease.
The study in South Africa, though, is the first to analyse a grant scheme that is taking place in real life and on a massive scale, rather than in carefully controlled research conditions.
It also comes as other sub-Saharan African countries are mulling whether to introduce social welfare payments for poor households with children.
These systems "can substantially reduce unsafe partner selection by adolescent girls," said the paper.
"(They) are of potential importance for effective combination strategies for prevention of HIV."
There were limits to the advantages of the South African scheme, the investigators added.
It helped wean girls off dependence on "sugar daddies," but did not reduce their exposure to other HIV risks, such as having unprotected sex when drunk.
Nor did the grant scheme have any change in HIV risk for boys, who comprised half of the volunteers in the study.
The teenagers were from four urban and rural areas in Mpumalanga and the Western Cape.
The interviews were carried out between 2009 and 2012 when the grant scheme was expanding, and some eligible households received the money but others did not.