President Obama Wednesday declared his support for gay marriage in an interview, becoming the first U.S. president to do so while in office, citing generational shifts, his daughters and his conscience in explaining his shift from previous opposition.

“Over the course of several years as I have talked to friends and family and neighbors, when I think about members of my own staff who are in incredibly committed monogamous relationships, same-sex relationships, who are raising kids together, when I think about those soldiers or airmen or marines or sailors who are out there fighting on my behalf and yet feel constrained, even now that Don’t Ask Don’t Tell is gone, because they are not able to commit themselves in a marriage, 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 told ABC News’ Robin Roberts.

WATCH MSNBC COVERAGE OF THE PRESIDENT’S SAME SEX MARRIAGE POSITION:
[MSNBCMSN video=”http://www.msnbc.msn.com/id/45977840″ w=”592″ h=”346″ launch_id=”47359571″ id=”msnbc4d3e01″]

He added, according to an article posted on ABC’s website, “some of this is also generational. You know 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. They are much more comfortable with it.

Twitter reacts to Obama’s support for gay marriage

“You know, Malia and Sasha, they have friends whose parents are same-sex couples. There have been times where Michelle and I have been sitting around the dinner table and we’re talking about their friends and their parents and Malia and Sasha, 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,” he said.

Obama’s move, a day after North Carolina passed a constitutional amendment banning gay marriage, will create another dividing line between the president and former Massachusetts governor Mitt Romney, who opposes both gay marriage and civil unions.

It also puts Obama in the center of a controversial issue that divides along racial and generational lines. While support for gay marriage is much higher among Democrats than Republicans, some Democrats, particularly those over 65, as well as some blacks and Hispanics, oppose gay marriage.

“We are both practicing Christians and obviously this position may be considered to put us at odds with the views of others but, you know, when we think about our faith, the thing at root that we think about is, not only Christ sacrificing himself on our behalf, but it’s also the Golden Rule, you know, treat others the way you would want to be treated,” Obama said in the interview.

Follow Perry Bacon Jr. on Twitter at @perrybaconjr