By Terry Baynes

NEW YORK (Reuters) - An appeals court in New York ruled on Thursday that a law defining marriage as a union between a man and a woman is unconstitutional. It was the second federal appeals court to reject the law, which could go before the Supreme Court soon.

The ruling by the 2nd Circuit Court of Appeals was in favor of Edith Windsor, an 83-year-old woman who argued that the Defense of Marriage Act discriminates against gay and lesbian couples, violating equal protection provisions of the U.S. Constitution.

The Defense of Marriage Act was passed in 1996. Since then, six states have legalized same-sex marriage but, because of the 1996 law, the federal government does not recognize same-sex marriages performed in those states.

Supporters of same-sex marriage welcomed Thursday's ruling.

"Yet again, a federal court has found that it is completely unfair to treat married same-sex couples as though they're legal strangers," Windsor's lawyer, James Esseks of the American Civil Liberties Union, said in a statement.

Paul Clement, a lawyer for a congressional group that defended the law, did not immediately respond to a request for comment.

Brian Brown, the president of the National Organization for Marriage, the leading group opposing same-sex marriage, called the decision "yet another example of judicial activism and elite judges imposing their views on the American people."

Windsor is a former IBM computer programmer who married Thea Clara Spyer in Toronto, Canada, in 2007. The two had been engaged since 1967.

Spyer died in 2009 of multiple sclerosis, leaving all of her property to Windsor. Because the marriage was not recognized under federal law, Windsor had to pay more than $363,000 in federal estate taxes, according to her lawsuit.

Windsor's attorneys argued that the act violates the 14th Amendment of the U.S. Constitution, which guarantees equal protection under the law.

A federal court in New York agreed, and the ruling by the 2nd Circuit on Thursday upheld the lower court decision.

Windsor welcomed the ruling. "This law violated the fundamental American principle of fairness that we all cherish," she said in a statement released by the ACLU.

The law is being defended in court by a group appointed by the Republican majority in the U.S. House of Representatives, after the Obama administration said last year it considered the law unconstitutional and would no longer defend it.

The group argued that the law was needed to maintain a uniform definition of marriage, that it served the government's interest of saving money and that it helped encourage procreation.

The 2nd Circuit rejected those arguments.

The 2-1 decision also found that gays and lesbians are entitled to heightened protection from the courts, based on the history of discrimination the group has suffered.

"Homosexuals are not in a position to adequately protect themselves from the discriminatory wishes of the majoritarian public," Judge Dennis Jacobs wrote for the majority.

Judge Chester Straub, who dissented, argued that the federal definition of marriage should be left to the political process.

"If this understanding is to be changed, I believe it is for the American people to do so," he wrote.

The ruling did not address another provision of the law that says that states where same-sex marriage is illegal do not have to recognize same-sex marriages performed in states that permit it.

New York City Mayor Michael Bloomberg and state Attorney General Eric Schneiderman praised the ruling as a step towards equality. Schneiderman, who filed a friend-of-the-court brief together with Vermont and Connecticut in support of Windsor, had argued that the law was a sweeping intrusion into the states' right to regulate marriage.

The 2nd Circuit majority agreed, calling the law "an unprecedented breach of longstanding deference to federalism," the principle that allows states to regulate marriage.

Jacobs, the author of the majority opinion, was appointed to the court by former Republican President George H.W. Bush. He is not the first Republican appointee to rule against the Defense of Marriage Act. In May, a federal appeals court in Boston also found the law's central provision unconstitutional, with an opinion written by Republican appointee Judge Michael Boudin.

Federal district courts in California and Connecticut have also ruled against the law. The U.S. Supreme Court often reviews cases where courts strike down federal laws and it may take up the Defense of Marriage Act in coming months.

In its decision on Thursday, the 2nd Circuit acknowledged that its legal analysis avoided the "fair point" that same-sex marriage is unknown to history or tradition.

"But law (federal or state) is not concerned with holy matrimony," Jacobs wrote, in a reference to the principle of separation between the state and religion. "For that, the pair must go next door," he wrote.

The case is Windsor v. USA et al, 2nd U.S. Circuit Court of Appeals, No. 12-2335.

(Reporting by Terry Baynes; Additional reporting by Dan Levine; Editing by Eddie Evans and Claudia Parsons)