ObjectiveTo evaluate the effect of comprehensive knowledge of HIV on extramarital sexual relationships and consistent condom use.DesignQuasi-experimental study.Setting20 880 households, Uganda.ParticipantsMarried/cohabiting men and women, aged 15–54 years.MethodsWe applied propensity score-matched analysis and defined comprehensive knowledge of HIV as knowing that consistent use of condoms during sexual intercourse and having just one faithful partner without HIV reduces the chance of getting HIV, knowing that a healthy-looking person can have HIV and rejecting two local misconceptions (HIV can be transmitted by mosquito bites and by sharing food with a person who has HIV). The primary outcome was extramarital sexual relationship defined as involvement in a sexual relationship with a partner other than a spouse or cohabiting partner, within 12 months preceding the survey. The secondary outcome was consistent condom use, defined as using a condom at every sexual intercourse with any non-spouse/non-cohabiting partner over the past 12 months.ResultsAmong 18 504 participants matched in a 1:1 ratio, comprehensive knowledge of HIV showed no effect on extramarital sexual relationships (OR 1.03, 95% CI 0.96 to 1.11) but improved consistent condom use among married/cohabiting couples in extramarital sexual relationships (OR 1.18, 95% CI 1.02 to 1.37). Among married/cohabiting men, comprehensive knowledge of HIV had no effect on extramarital sexual relationships (OR 0.95, 95% CI 0.83 to 1.08) but improved consistent use of condoms in extramarital sexual relationships (OR 1.31, 95% CI 1.04 to 1.66). However, among married/cohabiting females, there was no effect on both outcomes.ConclusionsComprehensive knowledge of HIV has no effect on extramarital sexual relationships but increases consistent condom use among those in extramarital sexual relationships. There is a need to consistently provide correct HIV prevention messages among sexually active married/cohabiting couples in Uganda.