(CNN) -- A federal judge in Boston, Massachusetts, has ruled that the federal ban on gay marriage is unconstitutional, because it interferes with an individual state's right to define marriage.

The ruling gives same-sex married couples in Massachusetts the same right to federal benefits that heterosexual couples enjoy.

U.S. District Judge Joseph Tauro ruled that "as irrational prejudice plainly never constitutes a legitimate government interest," the Defense of Marriage Act (DOMA) violates the protection under the Fifth Amendment to the Constitution.

Tauro ruled simultaneously in favor on two separate lawsuits that were filed by the Gay & Lesbian Advocates & Defenders (GLAD) on behalf of eight same-sex married couples and three widows, and by the Commonwealth of Massachusetts, where same-sex marriage has been permitted for over six years.

Massachusetts Attorney General Martha Coakley called the ruling "a victory for civil rights." Coakley, who attended court Thursday for the ruling, told reporters, "All citizens who are married in Massachusetts should be treated equally."

Tauro ruled that in DOMA it was "only sexual orientation that differentiates a married couple entitled to federal marriage-based benefits from one not so entitled."

He added that "the relevant distinction to be drawn is between married individuals and unmarried individuals. To further divide the class of married individuals into those with spouses of the same sex and those with spouses of the opposite sex is to create a distinction without meaning,"

Nancy Gell, one of the plaintiffs in the case said that she let out a huge "Yahoo!" when she heard the ruling on television as she was cooking dinner. "We are just absolutely thrilled, I am so happy I can't ever put it into words," she told reporters.

Coakley who said that she believed that DOMA statute had no purpose other than to discriminate, said that the ruling applied to all same-sex married couples in Massachusetts.

Gary Buseck, GLAD's legal director, said that Thursday's ruling "is for the Commonwealth of Massachusetts, so it seems to be encompassing all of the same-sex married couples in Massachusetts." He added that it would be "highly unusual" if the ruling was not appealed.

Department of Justice spokeswoman Tracy Schmaler said of the ruling, "We are reviewing the decision."