President Barack Obama on Saturday credited his daughters and gay couples he knows for helping him change his mind on marriage equality.

Obama endorsed equal marriage rights for gay and lesbian couples in 2012. Previously, he supported civil unions for gay couples.

At a town hall with young UK leaders in London, Obama was asked which social movements have influenced him the most.

“[I]n the United States what's been remarkable is the rapidity with which the marriage equality movement changed the political landscape and hearts and minds, and resulted in actual changes in law,” the president answered. “It's probably been the fastest set of changes in terms of a social movement that I've seen.”

Obama said that he entered the White House as an ally of the LGBT community.

“But on marriage equality, I was in favor of what's called civil unions. My notion was initially that labeling those partnerships as marriage wasn't necessary as long as people were getting the same rights, and it would disentangle them from some of the religious connotations that marriage had in the minds of a lot of Americans,” Obama said.

“I have to confess my children generally had an impact on me. People I loved who were in monogamous same-sex relationships explained to me what I should have understood earlier, which is it was not simply about legal rights but about a sense of stigma, that if you're calling it something different it means that somehow it means less in the eyes of society.”

“I believe that the manner in which the LGBT community described marriage equality as not some radical thing, but actually reached out to people who said they care about family values, and said, if you care about everything that families provide -- stability and commitment and partnership -- then this is actually a pretty conservative position to take, that you should be in favor of it. I thought there was a lot of smarts in reaching out and building and framing the issue in a way that could bring in people who initially didn't agree with them,” he added.