The United States House of Representatives granted final congressional approval on Thursday to legislation that offers government recognition of same-sex marriages, a step prompted by concerns that the Supreme Court would alter its support for such relationships, news agency Reuters reported.


The result in the House was 258-169, with all Democrats and 39 Republicans voting in favour - however 169 Republicans voted against it and one voted "present." The bill now heads to Democratic President Joe Biden's desk for his approval. The Respect for Marriage Act, as it is known, was approved by the Senate last month.


The measure was endorsed by LGBT supporters as well as a number of religious groups and institutions, including the Church of Jesus Christ of Latter-day Saints, however many religious conservatives in the United States continue to reject homosexual marriage as contrary to biblical text.


It is specifically constructed to serve as a limited backup for the Obergefell v. Hodges ruling, which legalised same-sex marriage nationwide in 2015. It would allow the federal government and states to recognise same-sex and interracial marriages as long as they were lawful in the states where the marriages took place. It allows exceptions for religious organisations and institutions who oppose such weddings.


The bill would overturn the Defense of Marriage Act of 1996, which, among other things, barred same-sex couples from receiving government benefits. It prohibits governments from invalidating out-of-state marriages on the basis of gender, race, or ethnicity. Interracial marriage bans were found unlawful by the Supreme Court in 1967.


However, the law would not prevent states from prohibiting same-sex or interracial marriages if the Supreme Court permitted it. It also prevents religious organisations from being forced to supply products or services for any marriage and from being denied tax-exempt status or other privileges for refusing to recognise same-sex weddings.


Democratic House Speaker Nancy Pelosi slammed the "hateful movement" behind attacks on LGBT rights in the United States in a speech on the House floor before of the vote.


According to Pelosi, the legislation "will help prevent right-wing extremists from upending the lives of loving couples, traumatizing kids across the country and turning back the clock on hard-won prizes," Reuters reported.


It was approved by the Senate by a vote of 61-36, with 12 Republicans joining 49 Democrats in support. The majority of Senate Republicans voted no.


A larger version of the measure, without explicit provisions for religious liberty, was approved by the 435-member House in August, with unanimous support from all Democrats and 47 Republicans. However, in order to obtain the requisite 60 votes in the Senate to proceed with the law, its co-sponsors introduced an amendment specifying that religious organisations could not be sued under it.


The proposal was drafted by a bipartisan group of Democratic and Republican senators in response to concerns that the Supreme Court, with its more assertive conservative majority, would eventually overturn the Obergefell decision, threatening same-sex marriage across the country. The court has demonstrated a readiness to reject its own precedents, such as when it reversed its landmark 1973 judgement that legalised abortion nationally in June.


The conservative majority of the Supreme Court appeared ready to rule on Monday that a Christian web designer has the right to refuse to provide services for same-sex marriages, in a case that liberal justices said could empower certain businesses to discriminate based on constitutional free speech protections.


According to the Census Bureau, there are around 568,000 married same-sex couples in the United States.


(With Inputs From Reuters)