Barack Obama has become the first US president to say publicly he was in favour of same-sex marriage, in a high-stakes intervention in a pre-election debate roiling American politics.
In what supporters will hail as a historic moment in civil rights history, Obama changed his stance, after previously saying he was "evolving" on gay marriage, a fiercely divisive issue in US politics.
"I've just concluded, for me, personally, it is important for me to go ahead and affirm that I think same-sex couples should be able to get married," Obama said in an interview with ABC News.
The president said however that a decision on whether to legalise gay marriage should be left to individual states. He also talked about how he and his wife Michelle had squared his decision with their faith.
"We are both practicing Christians and obviously this position may be considered to put us at odds with the views of others," he said.
"But it's also the Golden Rule, you know - treat others the way you would want to be treated."
Obama, who previously backed strong protections for gay and lesbian couples but not full marriage, said his position had evolved after talking to his two daughters Malia and Sasha who had friends who had same-sex parents.
"It wouldn't dawn on them that somehow their friends' parents would be treated differently. It doesn't make sense to them and frankly, that's the kind of thing that prompts a change in perspective," Obama said in the interview.
Mitt Romney, the presumptive Republican nominee for president, responded by affirming his belief marriage should be restricted to one man and one woman.
He had held that view "since running for office".
Romney called same sex-marriage "a very tender and sensitive topic'' but did not go so far as to accuse Obama of changing his position on the issue.
Questioned by reporters, he said news reports indicate Obama has shifted his stance.
Romney said states should be able to decide whether to grant certain legal benefits to same-sex couples.
Obama came under increasing political pressure on gay marriage after Vice President Joe Biden said on NBC's Meet the Press on Sunday that he was "absolutely comfortable" with same-sex marriage.
Some political analysts have warned that Obama could be entering a political minefield, with some key voting blocs in swing states that he hopes to court in November's election opposing gay marriage.
On Tuesday, voters in North Carolina, a state Obama narrowly carried in the 2008 election, approved a state constitutional amendment forbidding gay marriages, civil unions and domestic partnerships.
The measure was passed by 61 per cent to 39 per cent after similar state constitutional amendments had been approved in some 30 US states.
The amendment solidifies and expands already enacted North Carolina law forbidding same-sex marriage.
Religious conservatives will likely condemn Obama for his move, which will set up an interesting bout with Republican White House hopeful Mitt Romney for the affections of independent voters on the issue.
But there are signs that broader public opinion on gay marriage is moderating, though conservative groups are redoubling efforts to thwart the pro-gay lobby, seeking constitutional bans on gay marriage.
In a Gallup poll conducted between May 3 and 6, 50 per cent of Americans said they backed gay marriage, while 48 per cent said it should not be legalised.
Gay rights supporters praised Obama for his move, which may have the potential to fire up his political base, which had been less excited about his reelection bid than it was about his first candidacy four years ago.
"President Obama made history by boldly stating that gay and lesbian Americans should be fully and equally part of the fabric of American society," said Joe Solmonese of the Human Rights Campaign.
"His presidency has shown that our nation can move beyond its shameful history of discrimination and injustice.
"President Obama extends that message of hope to a generation of young lesbian, gay, bisexual and transgender Americans, helping them understand that they too can be who they are and flourish as part of the American community."
New York Mayor Michael Bloomberg also praised Obama's move.
"This is a major turning point in the history of American civil rights," Bloomberg said.
"No American president has ever supported a major expansion of civil rights that has not ultimately been adopted by the American people - and I have no doubt that this will be no exception."
Rea Carey, executive director of the National Gay and Lesbian Task Force, said: "Congratulations, Mr President, for making history today by becoming the first sitting president to explicitly support marriage for same-sex couples."