(CNN) -- President Barack Obama said Wednesday he supports same-sex marriage, raising the political stakes on an issue in which Americans are evenly split.
The announcement, long sought by supporters of same-sex marriage, puts Obama squarely at odds with presumptive Republican presidential nominee Mitt Romney.
"At a certain point I've just concluded that 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.
Obama once opposed same-sex marriage. He later indicated his views were "evolving." His announcement Wednesday in support of same-sex marriage was the first by a sitting president.
It was not immediately clear how Obama's decision might play out at the voting booth.
A Gallup Poll released Tuesday indicated 50% of Americans believe same-sex marriages should be recognized by law as valid, with 48% saying such marriages should not be legal.
But a CNN/ORC poll, taken in late March, indicated policies towards gays and lesbians were tied for last in the most-important issues facing the country.
Obama was "disappointed" by Tuesday's vote on the issue in North Carolina, which he described as discriminatory against gays and lesbians, a spokesman said earlier Wednesday.
North Carolina voted to implement a state constitutional ban on same-sex marriage, which was already prohibited by state law. Supporters of the measure pushed for the constitutional amendment, arguing that it was needed to ward off future legal challenges.
The president said he supports the concept of states deciding the issue on their own, ABC News reported.
Obama said his daughters, Malia and Sasha, have friends whose parents are same-sex couples. "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 spoke Wednesday with ABC's Robin Roberts. The interview will appear on ABC's "Good Morning America" Thursday. Excerpts were to air Wednesday evening on "World News With Diane Sawyer."
The president's stance will be among many key differences with Romney, but it is not expected to be a key talking point in his campaign.
In comments Wednesday to CNN Denver affiliate KDVR, Romney reiterated his opposition to same-sex marriage.
"And I do not favor civil unions if they are identical to marriage other than by name," Romney said during a visit to Fort Lupton. "My view is the domestic partnership benefits, hospital visitation rights, and the like are appropriate, but that the others are not."
Ralph Reed, a top organizer among religious conservatives, said Obama's announcement was a "gift to the Romney campaign."
But an expert on religion and politics said the move will make "an already close election even closer."
"It cuts both ways -- it activates both Democratic and Republican base voters," said John Green of the University of Akron.
Obama told ABC that some opinions on the issue are "generational."
"When I go to college campuses, sometimes I talk to college Republicans who think that I have terrible policies on the economy, on foreign policy, but are very clear that when it comes to same-sex equality or, you know, sexual orientation, that they believe in equality," he said.
First lady Michelle Obama was involved in the president's decision.
"This is something that, you know, we've talked about over the years and she, you know, she feels the same way, she feels the same way that I do," Obama said.
The new president of the Human Rights Campaign lauded the development.
"President Obama's words today will be celebrated by generations to come," Chad Griffin said. "For the millions of young gay and lesbian Americans across this nation, their president's words provide genuine hope that they will be first generation to grow up with the freedom to fully pursue the American dream."
The Family Research Council said it was disappointed by Obama's stance.
"From opposing state marriage amendments to refusing to defend the federal Defense of Marriage Act to giving taxpayer-funded marriage benefits to same-sex couples, the president has undermined the spirit if not the letter of the law," said the council's president, Tony Perkins.
Obama's interview followed recent comments by other key administration figures.
Vice President Joe Biden said Sunday on NBC he was "absolutely comfortable" with couples of the same gender marrying, leading observers to wonder when Obama would again address the issue.
Education Secretary Arne Duncan on Monday also made headlines when he openly backed same-sex marriage rights. Asked on MSNBC's "Morning Joe" if he supports allowing individuals of the same gender to legally wed, Duncan replied: "Yes, I do."
Before Tuesday, 30 states had voted in favor of constitutional amendments that seek to defend traditional definitions of marriage as a heterosexual union.
Massachusetts, Connecticut, Iowa, Vermont, New Hampshire, New York and the District of Columbia issue marriage licenses to same-sex couples.
In February, Washington Gov. Christine Gregoire signed a bill that would legalize same-sex marriage beginning in June, but opponents there have pledged to block the bill and called for voters to decide the issue.
Maryland Gov. Martin O'Malley signed into law a bill that permits the state's same-sex couples to wed as of January 1, and state residents may vote to affirm such a law. Minnesota will vote on a state constitutional amendment similar to the one in North Carolina. Maine will have a referendum on allowing same-sex marriage.
Legal challenges over same-sex marriage could reach the U.S. Supreme Court in coming months, but it seems unlikely justices would hear arguments before Election Day 2012.
The issue is on two legal tracks.
The Ninth Circuit U.S. Court of Appeals will decide the constitutionality of California Proposition 8, a voter-approved measure that would recognize marriage only between one man and one woman. A federal judge earlier struck down the law as a violation of equal protection, prompting the current appeal.
The Obama administration announced last year it believed the Defense of Marriage Act, often referred to as DOMA, to be unconstitutional. The law defines marriage for federal purposes as unions only between a man and woman.
A federal appeals court in Boston last month heard a DOMA lawsuit by a same-sex couple in Massachusetts. At issue is whether the federal government can deny tax, health and pension benefits to same-sex couples in states where they can marry.
That federal law is being officially defended in court by House Republicans, led by Speaker John Boehner, R-Ohio, who stepped in after the Justice Department refused to participate.
CNN's Jessica Yellin, Bill Mears, Dan Gilgoff and Jim Acosta contributed to this report.