A judge in Boston, Massachusetts, has ruled that America’s federal ban on gay marriage is unconstitutional as it interferes with the individual rights of states.

The ruling means the estimated 16,000 married gay couples in Massachusetts have the right to the same federal benefits enjoyed by married straight couples.

Massachusetts was the first US state to legalise gay marriage in 2004 and is the first to challenge the controversial Act, introduced in 1996.

President Barack Obama promised to repeal the Defence of Marriage Act (DOMA) in his election campaign, calling it “abhorrent”.

It states that only a marriage between one man and one woman will be recognised for federal purposes, thus barring gay married couples from a number of rights, including federal healthcare benefits.

In his ruling yesterday, US District Judge Joseph Tauro said that “irrational prejudice plainly never constitutes a legitimate government interest”, and that DOMA violates the Fifth Amendment.

He ruled simultaneously on two separate lawsuits brought to challenge the ban. One was filed by the Gay & Lesbian Advocates & Defenders (GLAD) on behalf of eight gay married couples and three widows and the other was filed by Massachusetts Attorney-General Martha Coakley.

Ms Coakley said the decision was “a victory for civil rights”.

Mary Bonauto, GLAD’s civil rights project director, who argued the case, said: “Today the court simply affirmed that our country won’t tolerate second-class marriages.

“I’m pleased that Judge Tauro recognised that married same-sex couples and surviving spouses have been seriously harmed by DOMA and that the plaintiffs deserve the same opportunities to care and provide for each other and for their children that other families enjoy. This ruling will make a real difference for countless families in Massachusetts.”

Nancy Gill, who was a plaintiff with her wife, Marcelle Letourneau, said: “I am thrilled that my family will now be treated in the same way as those of my married co-workers at the post office.

“Marcelle and I married out of love and commitment to each other first and foremost, but federal recognition of our marriage means that we’ll have equal access to important protections for our two children and for ourselves.”

The Obama administration may appeal the ruling, although legal experts believe that if upheld by a higher court, the case could have far wider implications.

Boston College professor Kent Greenfield, a constitutional law expert, told AP today that the rulings could encourage other attorney-generals to challenge DOMA in their states,

“One thing that’s going to be really interesting to watch is whether the Obama administration appeals or not,” he said.

The Department of Justice has not yet said whether it will appeal.