Barack Obama's announcement that he supports gay marriage has boosted the hopes of rights groups around the world that other leaders will follow his example.

He said he came to the conclusion over the course of several years of talking to family and friends. But opponents condemned the US president's change of mind as a shameless appeal for votes.

Several countries, including Canada, Spain and Argentina, allow same-sex marriage, but far more countries ban it and dozens even forbid consensual same-sex relations.

Gay rights groups now hope Mr Obama's views will inspire more change.

"This is incredibly important, it's excellent news. The United States is a global leader on everything, and that includes gay rights," said Julio Moreira, president of the Rio de Janeiro-based Arco-Iris gay rights group.

"This will force other nations like Brazil to move forward with more progressive policies."

Vatican and other religious officials did not comment, but political leaders and others opposed to gay marriage condemned Mr Obama. In particular, politicians tied to Pentecostal and Catholic churches have spoken out strongly against same-sex marriage in Latin America.

"Barack Obama is an ethical man and a philosophically confused man," said Peruvian congresswoman Martha Chavez of the conservative Catholic Opus Dei movement.

"He knows that marriage isn't an issue only of traditions or of religious beliefs. Marriage is a natural institution that supports the union of two people of different sexes because it has a procreative function."

In Australia, where three bills that would allow gay marriage have been introduced in parliament, prime minister Julia Gillard said she would not be following Mr Obama's lead. She has consistently opposed gay marriage, though many members of her Labour Party support it.

"I've made my mind up and my position on this is well known," Ms Gillard told reporters in Canberra.

"I think it just reinforces this as a matter that people form their own views on, a deeply personal question people will think about, work their way through it; obviously President Obama has and he's announced a decision."

Religion-based opposition is strong in Egypt's conservative Muslim-dominated society, which rejects same-sex relations. Laws prohibiting "debauchery" or "shameless public acts" have been used to imprison gay men in recent years.

"This is unacceptable, because it is against religion, traditions and against God," said engineer Shady Azer in Cairo. "God created Adam and Eve. He didn't create two Adams or two Eves."

Gay marriage in legal in several countries; most are in Europe but others include Canada and South Africa. Several US states allow it, but voters in many other states, including North Carolina on Tuesday, have banned it with constitutional amendments.

In 2010, Argentina became Latin America's first country to approve gay marriage. Cesar Cigliutti, president of the Gay Community of Argentina group, said Mr Obama was only catching up to the rest of the world.

"It seems to me that by taking this position Mr Obama is aligning himself with the entire world, with these times we're living in, with the achievements of rights in other countries," Mr Cigliutti said.

In France, outgoing president Nicolas Sarkozy opposes gay marriage - though recent polls suggest that a majority of French voters support it. President-elect Francois Hollande, who defeated Mr Sarkozy in elections Sunday, made "the right to marry and adopt for all couples" part of his campaign platform, and has set legislative passage of a bill ensuring that right for no later than June of next year.

Spain adopted its gay marriage law when the country was ruled by the centre-left Socialist Party, but the centre-right Popular Party took control of the government late last year.

Prime minister Mariano Rajoy has said he would prefer civil unions instead, but his administration has made no move to change the current situation. His party does have an appeal of the gay marriage law pending before the country's Constitutional Court.

Jamaica's most prominent evangelical pastor and the island's political ombudsman, Bishop Herro Blair, said today: he was still taking in Mr Obama's announcement.

"For now, I can say that I cannot be mad at President Obama. We are in a society where people have choices. However, my belief runs contrary to his," Bishop Blair said in Kingston, the island's capital.

Though Mr Obama's change of heart did not appear to change the battle lines in the debate, those on one side felt they had won a powerful ally.

"We're living in other times where acceptance is growing more and more," said restaurant owner Carlos Santiago in Mexico City's Pink Zone gay district.

"It's impossible to hold back a wave, against something that is natural."

Anat Chen, a 20-year-old bartender in Jerusalem, Isreal, said she expected more to come.

"Everyone should be allowed to marry whoever they want," she said. "It matters that Obama said it. Whatever happens in America, the rest of the world follows."

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.