The Obama administration has admitted that the Defence of Marriage Act (DOMA) is discriminatory but has said it will still defend it in court.

The 1996 law restricts federal recognition of marriage to only that between a man and a woman. It means gay couples are barred from a number of federal benefits, such as healthcare rights. It also gives states the right not to recognise gay marriages performed in other states. President Barack Obama described it as “abhorrent” in his election campaign.

Association Press reports that court papers filed today show the administration wishes to repeal the law. However, the same briefing reveals the Justice Department will defend the statute as it can be argued that the law is constitutional.

It is the responsibility of the Justice Department to defend laws from constitutional attack.

“The administration believes the Defence of Marriage Act is discriminatory and should be repealed,” said Justice Department spokeswoman Tracy Schmaler, because it prevents equal rights and benefits.

The department is obligated “to defend federal statutes when they are challenged in court. The Justice Department cannot pick and choose which federal laws it will defend based on any one administration’s policy preferences,” Schmaler added.

A previous Justice Department briefing filed in June angered some gay rights campaigners, who said it compared gay marriage to incest and child marriage.

Other critics said he had essentially declared gay rights less important that black rights, on the anniversary of Loving v Virginia which struck down laws against interracial marriage in the state.

The case in question was brought by gay California couple.

Last month, Massachusetts filed a lawsuit which argues that DOMA violates the US constitution by interfering with the right of states to define the marriage status of their own residents.

It was the first US state to legalise gay marriage in 2004 and is now the first to challenge the controversial Act.

The suit, filed by state Attorney General Martha Coakley in the US district court in Boston, also states the 1996 Act forces states to discriminate against gay married couples regarding various benefits rights.