Ending the AIDS pandemic by 2030 has been set as the goal by UN member nations. They've also pledged treatment for 30 million HIV sufferers by 2020. Critics say the New York declaration doesn't go far enough.
The UN AIDs conference set an ambitious timeline for eliminating the pandemic on Wednesday after nations such as Russia, Iran and Poland demanded sovereign rights on how they treat gay men in their countries.
General Assembly President Mogens Lykketoft said "cultural sensitivities" had played a big role but in the end 193 assembly nations represented at the summit had evidence of "what works."
UNAIDS agency head Michel Sidibe said for the first time AIDS in Africa had reached a "tipping point."
The compromise declaration adopted by member states seeks by 2020 to reduce new HIV infections to below 500,000 cases a year - down from 2.1 million in 2015 - and lower AIDS-related deaths to half a million - down from 1.1 million last year.
AIDS as a pandemic is to be ended by 2030.
Emphasis on 'most vulnerable'
The declaration builds on a previous five-year UN AIDS plan by placing more emphasis on those most vulnerable to HIV infection.
UN Secretary General Ban Ki-moon warned that "AIDS is far from over," but said the world could "radically change the trajectory of the epidemic" over the next five years.
Progress made during the past 15 years meant that more than 17 million people currently received life-saving antiretroviral treatment, Ban said.
Russia balks at decriminalization
Late on Tuesday, Russia led a push to strip language from an earlier draft that would have called for the decriminalization of homosexuality and drug use.
Canada and Australia expressed disappointment that the final text did not explicitly call for an end to discrimination against gay, bisexual and transgender persons.
A spokesman for the anti-AIDS group HealthGap, Mathew Kavanagh, said the targets would remain elusive "as long as critical populations like men who have sex with men are criminalized and stigmatized."
The US said the declaration should have put more emphasis on human rights.
UNAIDS head Sidibe welcomed the compromise declaration, saying it had not been easy to agree on the text but it would "certainly help up close the door and open a new one for ending AIDS."
A grandson of South Africa's late Nelson Mandela, Ndaba, who lost his father Makgatho to AIDS in 2005, had opened the conference with a call to 35 countries to end their travel restrictions on travelers with AIDS.
"Bigotry and fear do nothing but spread the virus," Ndaba Mandela told delegates.