His decision has been both welcomed by gay rights groups and attacked by political opponents, heralding the start of a fight on the polarizing issue ahead of the 2012 elections.
Mr Obama, who has always stopped short of explicitly endorsing gay marriage by often explaining that his views on the subject were “evolving”, declared that “I have hesitated on gay marriage in part because I thought that civil unions would be sufficient.
“I was sensitive to the fact that for a lot of people the word marriage was something that invokes very powerful traditions, religious beliefs and so forth.
“I’ve just concluded that for me personally it is important for me to go ahead and affirm that same-sex couples should be able to get married.”
The President said that his daughters Malia and Sasha had friends with same-sex parents, explaining that “it wouldn’t dawn on them that somehow their friends’ parents would be treated different”.
“It doesn’t make sense to them and frankly, that’s the kind of thing that prompts a change in perspective.”
The announcement comes on the heels of an interview given on Sunday by Vice President Joe Biden, in which he said that he was “completely comfortable” with gay people getting married.
It was widely viewed as a change of stance by the administration even though Mr Biden framed it as a personal opinion.
Opinion polls have shown that Americans increasingly approve of same sex marriage, but the issue is likely to be unpopular in key election battleground states.
President Obama’s politically explosive altering of his position comes as voters in North Carolina, a state that could become either Republican or Democrat in the coming election, approved an amendment to the state constitution that marriage may only be the union of a man and a woman.
Republican presidential frontrunner Mitt Romney said: “I have the same view on marriage as I had when I was governor and that I have expressed many times.
“I believe that marriage is a relationship between a man and a woman.”
Former Republican presidential candidate Rick Santorum said: “President Obama has consistently fought against protecting the institution of marriage from radical social engineering at both the state and federal level.”
“The march of freedom that has sustained our country since the Revolution of 1776 continues, and no matter what setbacks may occur in a given state, freedom will triumph over fear and equality will prevail over exclusion.”
National Gay and Lesbian Task Force director Rea Carey said: “Who benefits? Millions of families who now know that their country’s leader believes in fairness for all. This is a great day for America.”
Gay marriage is legal in six states in America, and Washington DC and Maryland have passed legalisation laws that have not taken effect yet.
Although Mr Obama opposed gay marriage during his 2008 election campaign, his administration has since backed a number of initiatives improving gays rights, such as repealing of the US military’s “don’t ask, don’t tell” policy and giving same sex partners improved rights over medical decisions.
Meanwhile, Nigeria’s Same Sex Marriage (Prohibition) Bill 2011, as passed by the National Assembly, (Senate and House of Representatives) prescribes 10 years in prison for offences associated with same sex marriage.
Nigeria’s same-sex marriage (prohibition) bill is the “prohibition of relationships between persons of the same sex, celebration of marriage by them and, other matters connected herewith”.
The new legislation bans same-sex marriages and blessing ceremonies and criminalises anyone who attends or witnesses them. And it goes much further: it also proscribes any “public or private” affirmation of same-sex love and gay human rights.
This will criminalise gay organisations, gay churches, gay bars, gay blessings, gay safer sex education, gay newspapers, gay human rights advocacy and sympathetic advice and welfare support for vulnerable lesbians and gay men.
Newspaper, television, radio and internet discussions supportive of gay equality will become a criminal offence.
The catch-all nature of the new statute means, for example, that it will become a crime to attend a same-sex commitment ceremony, urge understanding and acceptance of lesbians and gays, impart information on HIV prevention to gay people or broadcast a radio interview with a gay person talking about his or her life.
Violations of the new legislation will be punished with an automatic five-year jail sentence.