The rights of married same-sex couples will come under scrutiny at the US Supreme Court on Wednesday in the second of two landmark cases being considered by the top judicial panel.

After the nine justices mulled arguments on a California law that outlawed gay marriage on Tuesday, they will take up a challenge to the legality of the Defense of Marriage Act (DOMA).

The 1996 law prevents couples who have tied the knot in nine states -- where same-sex marriage is legal -- from enjoying the same federal rights as heterosexual couples.

The plaintiff is Edie Windsor, an 83-year-old lesbian who was ordered to pay federal inheritance tax of $363,000 following the death of her partner of more than 40 years in 2009.

A heterosexual widow would not have faced the same demand. Windsor is challenging Section 3 of DOMA on the grounds it is discriminatory because it defines marriage as an act between a man and woman.

President Barack Obama's administration had opposed Windsor's bid to repeal Section 3 as it progressed through the lower courts, where the legislation was twice ruled as unconstitutional.

But the White House has since switched sides and is now calling for the law to be overturned, leaving DOMA to be defended by a group of Republican lawmakers, along with a coalition of religious and conservative groups.

"The case is pretty simple. It's about discrimination," said James Esseks, one of Windsor's lawyers.

"It doesn't make sense in America for a federal government to treat two different people married under the same state law, different ways. That is unfair, it is un-American and it should be unconstitutional."

Elizabeth Wydra, chief counsel for the Constitutional Accountability Center, added: "With respect to DOMA, it's an irrational federal discrimination against legally married same-sex couples.

"I think it is a pretty simple and clear case."

Opponents of Windsor's case, however, are contesting the portrayal of homosexuals as the victims of discrimination, describing them in a brief as "one of the most influential, best-connected, and best-organized groups in modern politics."

Some legal experts say the Supreme Court justices may decide that DOMA represents an interference of individual states' right to set marriage law.

"It may sound to some justices like DOMA infringes on federalism or states' rights," said David Cruz, a professor at the University of Southern California.

The court trod cautiously Tuesday as it considered the constitutionality of California's "Proposition 8," the ballot initiative through which in 2008 voters ended right to same-sex marriage in the nation's most populous state.

While it will take months to issue a ruling, several justices indicated they would be in no hurry to make a verdict that could extend the right to same-sex marriage to the entire country.

Justice Anthony Kennedy, whose remarks are closely watched as he is often the swing vote on the bench, voiced reluctance for the court to step into "uncharted waters" on a case involving Californian law.

Justice Samuel Alito, a conservative, spoke of a "lack of data" on same-sex marriage since it was first legalized in the Netherlands in 2001.

On a day long-awaited by both sides of the debate, thousands of gay rights advocates waving US and rainbow flags descended on the court, outnumbering a rally of religious activists opposed to same-sex marriage.

One demonstrator dressed in pink danced to music of Lady Gaga, the superstar singer and supporter of gay rights.

Among opponents, protesters pushed strollers and chanted: "Every child deserves a mom and dad."

"All people are capable of loving children, but all the love in the world can't turn a mother into a father or a father into a mother," said Cathy Ruse of the Family Research Council, a conservative Christian group.

Opinion polls have repeatedly indicated that most Americans now accept the principle of same-sex marriage, including an overwhelming majority of younger citizens.

Obama last May became the first US president to publicly back gay marriage.