While gay-rights activists celebrate gains in much of the world, their setbacks have been equally far-flung, and often sweeping in scope.
In Russia, a new law against "gay propaganda" has left gays and lesbians unsure of what public actions they can take without risking arrest. In India, gay-rights supporters were stunned by a recent high court ruling re-criminalizing gay sex. A newly signed law in Nigeria sets 10-year prison terms for joining or promoting any gay organization, while a pending bill in Uganda would impose life sentences for some types of gay sex.
In such countries, repression of gays is depicted by political leaders as a defense of traditional values. The measures often have broad support from religious leaders and the public, limiting the impact of criticism from outsiders. The upshot: A world likely to be bitterly divided over gay rights for years to come.
Globally, the contrasts are striking. Sixteen countries have legalized same-sex marriage nationwide, including Canada, South Africa, Argentina, Uruguay, Brazil and New Zealand as well as 10 European nations, and gay marriage is legal in parts of the United States and Mexico. Yet at least 76 countries retain laws criminalizing gay sex, including five where it's punishable by death.
Here's a look at major regions where the gay-rights movement remains embattled or marginalized:
According to human rights groups, more than two-thirds of African countries outlaw consensual same-sex acts, and discrimination and violence against gays, lesbians and transgender people is commonplace. While many of the laws date to the colonial era, opposition to homosexuality has gained increasing traction as a political tactic over the past two decades.
In 1995, President Robert Mugabe of Zimbabwe — who's still in office — denounced gays and lesbians as "worse than pigs and dogs." He has since been joined by political and religious leaders continent-wide calling for punishments ranging from arrest to decapitation.
Africans promoting anti-gay legislation have expressed alarm about gains made by sexual minorities in the United States and Europe. They say laws such as the one newly signed in Nigeria can serve as a bulwark against Western pressure to enshrine gay rights.
In Liberia, for example, a religious group called the New Citizen Movement has spent the past year collecting signatures urging President Ellen Johnson Sirleaf to sign a law banning same-sex marriage — even though, as in Nigeria, there has been no local movement to legalize it.
Rev. Cleopatra Watson, the group's executive director, said Nigeria's law was "a prayer answered" that could lead to the passage of similar legislation in other African countries.
From afar, Nigeria's new law has drawn harsh criticism from human rights groups, Western governments, and U.N. Secretary-General Ban Ki-moon. However, support for anti-gay legislation presents few domestic political risks for African leaders, with polls suggesting most citizens believe sexual minorities are not entitled to basic civil rights.
In Cameroon, gay men are routinely sentenced to prison for gay sex, and in July a prominent gay activist, Eric Ohena Lembembe, was tortured and killed in an attack.
Gay-rights supporters nonetheless hold out hope for long-term change, suggesting that recent anti-gay rhetoric and laws were a response to an emergence of sustained gay-rights activism.
"If there weren't an increasingly effective movement, there would not be such a virulent backlash," said Neela Ghoshal, a researcher at Human Rights Watch.
The world's largest continent, Asia is a mixed bag when it comes to gay issues, due to vast differences in culture, religion and history. Though no Asian nation yet allows gay marriage, Thailand has a government-sponsored campaign to attract gay tourists, while China, Vietnam and Taiwan, among others, are increasingly accepting of gays and lesbians.
However, Malaysia, Bangladesh and Pakistan outlaw gay sex and, for the moment, so does India, following the recent decision of its high court to revive a ban on gay sex that had been quashed by a lower court in 2009. The high court said it's up to lawmakers, not judges, to change the law.
Amid the legal wrangling, gays and lesbians have gained a degree of acceptance in parts of India, especially in big cities where gay-pride parades are now a fixture. Many bars have gay nights, and some high-profile Bollywood films have dealt with gay issues.
In most of the country, however, being gay is seen as shameful, and many gays remain closeted.
Gautam Bhan, an Indian gay activist, said he was heartened by the vocal outcry against the high court ruling.
"There may be a backlash and reversals, but the long-term trend is toward openness, freedom and diversity," he said. "Eventually we will get past this law."
In majority-Muslim Malaysia, the government has shown no interest in promoting gay rights. Sodomy is punishable by 20 years in prison and whipping with a rattan cane, and censorship rules forbid the production and screening of films that might be considered supportive of gay rights.
Earlier this month, the Home Ministry declared a coalition of activist groups illegal, partly because they were deemed to have championed gay rights.
"Malaysia is at the worst end of the scale," said Grace Poore, a Malaysian who is Asia program coordinator for the International Gay and Lesbian Human Rights Commission. "They are targeting LGBT people because they are convenient scapegoats."
In heavily Muslim Indonesia, gay sex is not criminalized, and many young, urban Indonesians are relatively tolerant of homosexuality, but most citizens consider it unacceptable.
"Gay people are still living in fear," said King Oey, chairman of the country's main gay-rights group.
While the gay-rights movement has achieved major victories in some South American countries, gays remain targets of violence and harassment in parts of Central America and the Caribbean.
In Honduras, activists report a serious problem of violence against gays, lesbians, bisexuals and transgender people. According to Human Rights Watch, more than 90 members of the LGBT community were killed between 2009 and 2012.
Several countries in the English-speaking Caribbean still have colonial-era laws criminalizing sex between men, including Jamaica, Barbados, Grenada, St. Lucia and Dominica. Gays in Jamaica say they suffer frequent discrimination and abuse, and have little recourse because of widespread anti-gay stigma.
"Homophobia is expected, celebrated, culturally ingrained," said Dane Lewis, leader of the Jamaica Forum for Lesbians, All Sexuals and Gays.
Anti-gay sentiment is fueled by some church leaders who accuse gays of flaunting their behavior to "recruit" youngsters, and some stars of Jamaican dancehall music use gay-bashing lyrics to rouse concertgoers.
For gay tourists, the Caribbean is generally safe, but not always. Masked gunmen broke into a vacation cottage in St. Lucia in 2011 and beat three gay Americans while making anti-gay slurs. In 2006, two gay men from New York were assaulted outside a bar in Dutch St. Maarten; one of the victims sustained brain damage.
In Cuba, homosexuality was frowned on in the early decades after Fidel Castro's 1959 revolution. Gays were commonly harassed by police, sent to work camps or dismissed from government jobs. Some fled into exile.
More recently, Castro apologized for the persecution. His niece, Mariela Castro, the daughter of current President Raul Castro, is a leading activist for LGBT rights on the island and has lobbied, so far unsuccessfully, for same-sex marriage.
Russia's law banning "gay propaganda" has drawn extensive criticism abroad, but seems to be widely accepted at home — perhaps not surprising in a country where a popular news anchorman recently said homosexuals' hearts should be buried or burned.
The law was signed in June by President Vladimir Putin after sailing through Parliament. It levies heavy fines on anyone convicted of propagandizing "nontraditional sexual relations" among minors.
Putin, in his third term, has been catering to an increasingly conservative constituency, repeating catch-phrases about Russia's traditional values and condemning the West for trends that threaten to destroy them, including homosexuality.
That language has struck a chord in much of Russia, where the rising influence of the Orthodox Church and widespread ignorance about gays has contributed to acceptance of the propaganda law. Polls indicate that the vast majority of Russians don't have a single gay acquaintance and oppose expansion of gay rights.
As a result, a growing cadre of public figures shows no hesitation to demonize gays.
State television anchor Dmitry Kiselyov told audiences that homosexuals should be banned from donating blood or organs, saying that they should be burned or buried instead. Kiselyov later was appointed by Putin to head Russia's largest news agency.
Ivan Okhlobystin, a popular actor and former priest, told his fans that he would gladly "burn them (gays) alive," calling them "a real danger to my children."
Gays face various problems in many other parts of Eastern Europe, including the Balkans, a traditionally conservative region where anti-gay violence has been on the rise. Assaults and harassment have coincided with the strengthening of right-wing groups amid persistent economic problems.
Conservative groups in Croatia, backed by the Roman Catholic Church, forced a referendum in December to define marriage as a union of a man and a woman only. Voters overwhelmingly supported the measure, dealing a blow to the liberal government and triggering criticism from the European Union, which had just admitted Croatia.
In Serbia, a gay pride march in 2010 resulted in daylong violence, with more than 100 people injured. Planned marches in subsequent years were canceled because of extremist threats.
Montenegro held its first pride event last year in the coastal town of Budva. Hundreds of police officers fought right-wing extremists who sought to disrupt the gathering, and participants were eventually evacuated in boats.
Across most of the Middle East, homosexual relations are taboo, though not all nations choose to prosecute homosexuals and punishments vary.
The pervasiveness of religion in everyday life, along with strict cultural norms, plays a major factor in how Middle Eastern societies view homosexuality. The common Arabic word used to refer to gays is derogatory and its actual meaning translates as "abnormal" or "queer."
Same-sex relations are punishable by death in the Muslim-majority nations of Iran, Mauritania, Saudi Arabia, Sudan and Yemen.
In Yemen, more than 30 people suspected of being of gay were killed by unidentified assailants in the past two years, many in southern provinces where al-Qaida is active. Iraq also has experienced a surge of killings of gays.
In Egypt, consensual same-sex relations are not explicitly prohibited, but other laws — those prohibiting "debauchery" or "shameless public acts" — have been used to imprison gay men.
Public acceptance of gays in Israel and Lebanon is higher than the rest of the region, according to a Pew Research Center study released last year. Lebanon and Israel promote gay tourism, and publisher Nabil Mroueh says his company in Beirut, Lebanon's capital, has translated nearly a dozen English books about homosexuality into Arabic.
Among most Palestinians, homosexuality is generally disdained, and gays tend to be secretive about their social lives. In the West Bank, a 1951 Jordanian law banning homosexual acts remains in effect, as does a ban in Gaza passed by British authorities in 1936.
In Israel, by contrast, gays serve openly in the military and in parliament, and many popular artists and entertainers are gay.
Assessing the region as a whole, activists take heart from modest changes — even it's simply the inclusion of gay rights in broader discussions about human rights in the Middle East.
"The situation doesn't look good," said Hossein Alizadeh, a Middle East specialist with the International Gay and Lesbian Human Rights Commission. "But that doesn't mean we stop working."
Associated Press writers contributing to this report included Aya Batrawy in Dubai; Robbie Corey-Boulet in Dakar, Senegal, Laura Mills in Moscow; Jovana Gec in Belgrade, Serbia; Aida Cerkez in Sarajevo, Bosnia; Ashok Sharma in New Delhi; Sean Yoong in Kuala Lumpur, Malaysia; Niniek Karmini in Jakarta, Indonesia; Ibrahim Barzak in Gaza City, Gaza Strip; Mohammed Daraghmeh in Ramallah, West Bank; Ian Deitch in Jerusalem; Peter Orsi in Havana, and David McFadden in Kingston, Jamaica.