In a new book, "Believer: My Forty Years in Politics," former chief advisor David Axelrod feared they'd lose too many votes, as he believed opposition to gay marriage was so strong in US black-majority churches.
"Opposition to gay marriage was particularly strong in the black church, and as he ran for higher office, he grudgingly accepted the counsel of more pragmatic folks like me, and modified his position to support civil unions rather than marriage, which he would term a 'sacred union,' Axelrod wrote in the book.
In August 2008, at a campaign event at Saddleback Church, Obama went on to tell pastor Rick Warren, "I believe that marriage is the union between a man and a woman. For me as a Christian, it is also a sacred union. God's in the mix."
But, Axelrod added: "Having prided himself on forthrightness, though, Obama never felt comfortable with his compromise and, no doubt, compromised position."
Obama came out in support of gay marriage during his 2012 re-election campaign, saying he had undergone an "evolution" on the issue.
"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," he told ABC News' Robin Roberts.