Canada's Supreme Court has said people with a low HIV viral load and who use condoms need not reveal their condition to a sexual partner.
The justices ruled 9-0 that disclosure was required only when transmission was "a realistic possibility".
Several HIV/Aids groups said condom use was enough, describing the viral load caveat as a "major step backwards".
The ruling modified a 1998 law that said failure to reveal HIV status was a form of aggravated sexual assault.
That law has meant carriers could face prosecution for aggravated sexual assault.
'Note of caution'
This time around the court was ruling on two cases on the issue - one from the province of Manitoba and the other from Quebec.
The court said that a person with a low HIV viral load does not put their partner at risk if a condom is used.
But it said standards could be subject to further change, in response "to future advances in treatment" or other risk factors that it had not addressed directly.
A viral load indicates the severity of the HIV infection. Some treatments aim to reduce viral load, making transmission of the condition less likely.
HIV/Aids groups say the law - even in its newly modified form - stigmatises people with the disease, and that "solid science" shows that the risk of contracting HIV is negligible when a condom is used.
"In practice, today's ruling means that people risk being criminally prosecuted even in cases where they exercised responsibility and took precautions, such as using condoms, which are 100% effective when used properly," the Canadian HIV/AIDS Legal Network said.
But prosecutors had argued that failure to disclose one's condition deprived a potential partner of their right to make an informed decision about consensual sex.
The court noted that in many countries, only actual transmission - and not merely risk of exposure - is considered a crime.
Friday's decision "sounds a note of caution against extending the criminal law beyond its appropriate reach in this complex and emerging area of law", the justices said.
A requirement that every person with HIV disclose their status to sexual partners could mean imprisoning people who had not exposed others to the virus, the court said.