Washington - The Supreme Court ruled on Friday that the US Constitution provides same-sex couples the right to marry, in a historic triumph for the American gay rights movement.The court ruled 5-4 that the Constitution's guarantees of due process and equal protection under the law meant that states could not ban same-sex marriages. With the ruling, gay marriage will become legal in all 50 states.Justice Anthony Kennedy, writing on behalf of the court, said that the hope of gay people intending to marry "is not to be condemned to live in loneliness, excluded from one of civilisation's oldest institutions. They ask for equal dignity in the eyes of the law. The Constitution grants them that right"/There are currently 13 state bans in place, while another state, Alabama, has contested a court ruling that lifted the ban there.The ruling is the Supreme Court's most important expansion of marriage rights in the United States since its landmark 1967 ruling in the case Loving vs Virginia that struck down state laws barring interracial marriages.The decision follows rapid changes in attitudes and policies toward gay marriage in America. It was not until 2003 that the Supreme Court threw out state laws banning gay sex. And it was not until 2004 that Massachusetts became the first state to legalise same-sex marriage. Gay marriage has gained increasing acceptance in opinion polls in recent years, particularly among younger Americans.