The Obama administration will appeal two cases that found portions of the federal Defense of Marriage Act (DOMA) unconstitutional.

U.S. District Judge Joseph Tauro ruled in July against the 1996 law that defines marriage as a heterosexual union for federal agencies and allows states to ignore the legal marriages of gay couples performed outside their borders.

Tauro's decision only considers the law's definition of marriage, which prohibits married gay and lesbian couples from accessing federal benefits. He ruled the law violates the Fourteenth Amendment's equal protection guarantee.

“As a policy matter, the president has made it clear that he believes DOMA is discriminatory and should be repealed,” DOJ spokeswoman Tracy Schmaler said, Reuters reported. “The Justice Department is defending the statute, as it traditionally does when acts of Congress are challenged. The Department of Justice has a long-standing practice of defending federal statutes when they are challenged in court, including by appealing adverse decisions of lower courts.”

Both challenges were filed in Massachusetts, the first U.S. state to legalize gay marriage. One was filed by Massachusetts Attorney General Martha Coakley and the other by several gay couples being represented by the Boston-based gay rights group Gay & Lesbian Advocates & Defenders (GLAD).

“DOMA is an unjust and unconstitutional law that discriminates against Massachusetts married couples and their families,” Coakley said in a statement.

GLAD said in a statement that it was not surprised by the administration's actions and that it was committed to seeing the challenge through to the end.

“There is no doubt that DOMA brings harm to families like our plaintiffs every day, denying married couples and their children basic protections like health insurance, pensions and Social Security benefits,” the group said.