The US Supreme Court has agreed to rule whether same-sex couples across the country should have the right to marry, setting the stage for a final historic decision.

The highest US court will examine cases in four states, Ohio, Michigan, Tennessee and Kentucky, which have banned gay marriage.

The court said it would hold a hearing in April to study whether the 14th Amendment requires a state to licence a same-sex marriage.

It will also study whether a state is required to recognise same-sex marriages that took place out-of-state.

The prospect of a final resolution to the thorny question has been welcomed by both supporters and opponents of same-sex marriage.

Human Rights Campaign President Chad Griffin said: "Marriage has returned to the US Supreme Court faster than virtually any other issue in American history, and there's a simple reason for that.

"Committed and loving gay and lesbian couples, their children, and the fair-minded American people refuse to wait a single day longer. 

"We've reached the moment of truth ... now the nine justices of the Supreme Court have an urgent opportunity to guarantee fairness for countless families, once and for all." 

Anti-same-sex marriage groups also praised the court's decision to take up the case.

"The US Supreme Court now has the opportunity to issue a long-overdue ruling to restore the freedom of the people to uphold marriage in their state laws as the union of a man and a woman," Family Research Council president Tony Perkins said.

In a landmark decision in June 2013, the Supreme Court struck down a law denying federal benefits to homosexual couples by defining marriage as a union between a man and a woman.

In doing so, it cleared the way for married gay and lesbian couples to enjoy the same rights and privileges under federal law as their straight counterparts.

But it stopped short of legalising same-sex marriage nationwide, leaving that question to the states.

At that time, only 12 states plus the capital Washington recognised same-sex marriages.

Since then, a patchwork legalisation of same-sex marriage has rolled out across America, with 36 states now allowing it.

Same-sex unions in the state of Florida, with its huge swathe of southern rural conservatism juxtaposed by large areas of urban liberalism, met with years of resistance before finally being allowed earlier this month.

With a few exceptions, the states that have refused to marry same-sex couples have lost in court, including in front of the Supreme Court.

The question has been up in the air since Massachusetts became the first state to legalise same-sex marriage in 2004.