Bangkok China's government considered homosexuality a mental disorder until 2001. Mobs in Senegal have disinterred bodies of men they believe were gays and dragged them through the streets. In Egypt, laws prohibiting "shameless public acts" have been used to imprison gay men.
While gay-rights activists hailed President Barack Obama's support for same-sex marriage as a symbolic victory, for many around the world the idea of legal unions between homosexuals is a distant dream. Gay people in many countries would settle for simply getting to be themselves without fear of being attacked or thrown in prison.
In China, "the government treats homosexuality like it does not exist," said Xiong Jing, an activist who volunteers in gay support groups in Beijing.
China's authoritarian government shows little tolerance for activism of any kind, and sodomy was a crime until 1997. Xiong welcomed Obama's support for gay marriage, but cautioned that legalizing it in China would be unrealistic and impossible.
"If he, as president, was able to not just express his own personal opinion but to support policies on this, that would be even better," she said Thursday.
America's role as a global agent of change is exactly what worries people like Ibrahim Ali, an independent member of Malaysia's Parliament and leader of a rights group for the country's majority Malay Muslims.
"They can practice this in America if they want, since it's their right, but we are still very concerned, because whatever America practices, it often wants other countries to follow suit," he said.
The Vatican, a strident opponent of gay marriage, did not immediately comment on Obama's announcement. But two months ago Pope Benedict XVI denounced what he called the gay marriage lobby in America in a speech to visiting U.S. bishops and urged them not to back down in the face of "powerful political and cultural currents seeking to alter the legal definition of marriage."
On Thursday at the Vatican, visiting Dublin Archbishop Diarmuid Martin said the church's teaching on the sanctity of marriage between man and woman was clear, unchangeable, and dates from the biblical account of Adam and Eve in the book of Genesis.
"There's a sense in that that somehow or other, this diversity between the sexes represents something of the image of God itself," Martin told the AP. "It doesn't mean the rights of people in their lives can't be protected. But the institution of marriage for the church is not a social construct which can be changed."
With the exception of South Africa, much of Africa harbors a deep stigma against homosexuality. Violence has been rising against gays in the continent, and there have been cases of mobs digging up bodies from cemeteries in Senegal, allegedly of homosexuals, and parading them in the streets.
"I really like Barack Obama as a president, but not this latest declaration," said Mohamed Gueye, who sells Obama pencils alongside French conjugation guides at his bookstall in the Sandaga market in Dakar, the Senegalese capital.
Gladys Okai, a Ghanaian woman, was attacked for being a lesbian.
"My understanding of democracy is that everybody's right is guaranteed. President Obama is proving to be a proper believer in democracy ... he knows that people with other sexual orientations also have rights," she said.
Homosexuality also remains taboo in India, despite large gay pride parades recently in New Delhi and other big cities. Only this year, the government accepted a court ruling that struck down a British colonial-era law banning gay sex, and the Supreme Court is now hearing appeals.
Malaysia, another former British colony, rarely enforces its sodomy law. Still, it was used twice against Anwar Ibrahim, a leader of the opposition party who went to prison after a conviction in 2000 and was acquitted in a separate case early this year. Anwar denies being gay and says the charges were a trumped-up effort to remove him from politics.
Gays who speak out commonly become targets of abuse, such as Azwan Ismail, who drew anonymous death threats and criticism from Islamic officials when he spoke about his sexuality in a YouTube video in 2010.
In the overwhelmingly Catholic Philippines, the only country in the world apart from the Vatican where divorce is illegal, the issue of gay marriage is not even on the agenda of gay rights groups.
"We have some members who are religious, and their belief and devotion to God is there and is the biggest hindrance for them," said Goya Candelaria, spokesman of Pro Gay association.
Religious mores tend to be the most-frequently invoked objection by opponents of gay marriage around the world, especially in countries with strong Catholic and Muslim traditions.
"This is unacceptable, because it is against religion, traditions and against God," said Shady Azer, an engineer in Cairo. "God created Adam and Eve. He didn't create two Adams or two Eves."
Politicians tied to Pentecostal and Catholic churches in Latin America spoke out strongly against it.
"Barack Obama is an ethical man and a philosophically confused man," said Peruvian congresswoman Martha Chavez, a member of the conservative Catholic Opus Dei movement. "Marriage is a natural institution that supports the union of two people of different sexes because it has a procreative function."
In other places, Obama's endorsement of gay marriage was a ho-hum affair. Many European countries, as well as Canada, Argentina and South Africa, already allow gay marriage. So do six U.S. states and the District of Columbia.
Germany's openly gay foreign minister, Guido Westerwelle, praised Obama's move.
"I welcome this not just personally but also in the name of the German government," he said. "It's okay to marry gay."
In Germany, same-sex couples have been able to register civil partnerships since 2001 — although they legally fall short of formal marriage.
New Zealand's Prime Minister, John Key, broke his long silence on gay marriage and said his government may consider allowing it "at some stage."
But in Australia, where polls show that most people support gay marriage, the left-leaning Prime Minister Julia Gillard said she remains opposed, and three bills in Parliament that would allow same-sex couples to marry are unlikely to pass.
France also has a population largely in support of gay marriage. Francois Hollande, who defeated President Nicolas Sarkozy in an election Sunday, has made "the right to marry and adopt for all couples" part of his campaign platform.
Associated Press writers Nick Perry in Wellington, New Zealand; Gillian Wong in Beijing; Thanyarat Doksone in Bangkok; Sean Yoong in Kuala Lumpur, Malaysia; Ashok Sharma in New Delhi; Hrvoje Hranjski, Oliver Teves and Teresa Cerojano in Manila; Rod McGuirk in Canberra, Australia; Maggie Michael in Cairo; Jack Chang in Mexico City; Franklin Briceno in Lima, Peru; Debora Rey in Buenos Aires, Argentina, Donna Byrson in Johannesburg, Francis Kokutse in Accra, Ghana; Krista Larson in Dakar, Senegal; Divine Ntaryike in Douala, Cameroon, Saleh Mwanamilongo in Kinshasa, Congo; Maureen Mudi in Mombasa, Kenya contributed to this report.