The Baird government will finally close the door on a chapter of NSW history that involved harsh laws being enacted at the height of the AIDS epidemic, driven by a fear of the unknown and public panic.

The offence of having sex without first disclosing you have a sexually transmitted disease will be removed from the Public Health Act next year.

David Cooper, director of the Kirby Institute at the University of NSW, diagnosed Australia's first case of HIV and was the director of the St Vincent's AIDS unit at the height of the epidemic.

Professor Cooper said it was "good timing" to remove section 79 of the Public Health Act. Since 2010 international studies had shown that if HIV is treated and becomes undetectable, it can't be transmitted to a partner, he said.