In a written response to questions from US gay newspaper Washington Blade, Barack Obama said "LGBT Americans deserve real change, and they deserve it now."
He reiterated his opposition the the Defence of Marriage Act (DOMA) which bars the federal government from recognising same-sex marriages, and said that the US Armed Forces should allow gay people to serve openly.
"I’m running for President to build an America that lives up to our founding promise of equality for all — a promise that certainly extends to the LGBT community," he wrote.
"I do envision a time when we all enjoy that promise, but we have to work hard to get there. LGBT Americans deserve real change, and they deserve it now.
"Certainly as a nation we can all agree that discrimination has no place in our America.
"Same-sex couples face legal discrimination every day — that we can, and must, end — by repealing DOMA, providing federal rights and responsibilities to same-sex families, and supporting LGBT parents, to start.
However, the candidate did not answer a question on organisations such as the Boy Scouts barring gay people and another that got to the heart of his stance on gay marriage:
"If the full repeal of DOMA forces all states to recognise same-sex marriages passed by just a few states, aren't you, in effect, supporting same-sex marriage in the United States?"
Senator Obama does not support gay marriage.
"I support the notion that all people — gay or straight — deserve the same rights and responsibilities to assist their loved ones in times of emergency, deserve equal health insurance and other employment benefits currently extended to heterosexual married couples, and deserve the same property rights as anyone else," he wrote.
"If elected, I would call on Congress to enact legislation that would repeal DOMA and ensure that the over 1,100 federal legal rights and benefits currently provided on the basis of marital status are extended to same-sex couples in civil unions and other legally recognised unions."
On a more personal note, the 47-year-old, who faces Republican Senator John McCain in November's Presidential election, spoke about he and his wife's gay, lesbian and trans friends.
"Michelle and I have been blessed with many openly gay and lesbian friends and colleagues whom we have been close to for many years," he wrote.
"While that fact has made the issue facing the LGBT community more personal, the fundamental reasons I have for supporting equality are greater than any individual.
"I am running for President because I believe that we as a nation need change. We need to end the divisive politics of George W Bush and pursue policies that treat all of us, regardless of identity or background, with dignity, equality and respect."
Senator Obama said that one of his professors at college helped him to understand the concerns of the LGBT community.
"He was the first openly gay professor that I had ever come in contact with, or openly gay person of authority that I had come in contact with," he wrote.
"And he was just a terrific guy. His comfort in his own skin and the friendship we developed helped to educate me on a number of these issues."
Senator McCain opposes gay adoption and has said of marriage:
"Union - a union between a man and a woman, between one man and one woman. That's my definition of marriage."
He does not back a constitutional amendment on the matter.
However, during an appearance on The Ellen DeGeneres Show in May he told the host, who was about to marry her girlfriend Portia De Rossi:
"I think that people should be able to enter into legal arrangements.
"I think that is something we should encourage, particularly in the case of insurance and other areas, decisions that have to be made.
"I just believe in the unique status between man and woman, and I know that we have a respectful disagreement on that issue."