"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's Robin Roberts.
Obama's comments came three days after Vice President Joe Biden said in a television interview that he was comfortable with gay marriage.
This is the first time Obama has said publicly that he supports gay marriage, an issue that is divisive for many Americans. Pressure built on the president to clarify his views after Biden and other cabinet members came out in favor of allowing gay and lesbian people to wed.
ABC said Obama described his views as personal and still supported the concept that states should be able to decide on the issue.
'Another step towards equality'
The president, who ended the "Don't Ask, Don't Tell" policy that prevented gays from serving openly in the military, said watching members of his staff who are in committed same-sex relationships and thinking about "soldiers or airmen or marines or sailors who are out there fighting on my behalf and yet feel constrained" had affected his thinking.
Human Rights Campaign, a gay advocacy group, said Obama had "made history" with the comments, and Neera Tanden from the Center for American Progress said the expression of support was "another large step toward realizing this country's promise of equality."
Obama mentioned his children as an influential factor and said his wife, first lady Michelle Obama, shared his views.
"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," Obama said, according to a transcript.
"It doesn't make sense to them and frankly, that's the kind of thing that prompts a change in perspective."
- Receive Ynetnews updates
directly to your desktop