WASHINGTON — The Supreme Court will take up California’s ban on same-sex marriage, a case that could give the justices the chance to rule on whether gay Americans have the same constitutional right to marry as heterosexuals.

The justices said Friday they will review a federal appeals court ruling that struck down the state’s gay marriage ban, though on narrow grounds. The San Francisco-based appeals court said the state could not take away the same-sex marriage right that had been granted by California’s Supreme Court.

The court also will decide whether Congress can deprive legally married gay couples of federal benefits otherwise available to married people. A provision of the federal Defense of Marriage Act limits a range of health and pension benefits, as well as favorable tax treatment, to heterosexual couples.

The cases probably will be argued in March, with decisions expected by late June.

Gay marriage is legal, or will be soon, in nine states — Connecticut, Iowa, Maine, Maryland, Massachusetts, New Hampshire, New York, Vermont, Washington — and the District of Columbia. Federal courts in California have struck down the state’s constitutional ban on same-sex marriage, but that ruling has not taken effect while the issue is being appealed.

But 31 states have amended their constitutions to prohibit same-sex marriage. North Carolina was the most recent example in May. In Minnesota earlier this month, voters defeated a proposal to enshrine a ban on gay marriage in that state’s constitution.

The biggest potential issue before the justices comes in the dispute over California’s Proposition 8, the state constitutional ban on gay marriage that voters adopted in 2008 after the state Supreme Court ruled that gay Californians could marry. The case could allow the justices to decide whether the U.S. Constitution’s guarantee of equal protection means that the right to marriage cannot be limited to heterosexuals.

A decision in favor of gay marriage could set a national rule and overturn every state constitutional provision and law banning same-sex marriages. A ruling that upheld California’s ban would be a setback for gay marriage proponents in the nation’s largest state, although it would leave open the state-by-state effort to allow gays and lesbians to marry.

In striking down Proposition 8, the 9th U.S. Circuit Court of Appeals crafted a narrow ruling that said because gay Californians already had been given the right to marry, the state could not later take it away. The ruling studiously avoided any sweeping pronouncements.

The larger constitutional issue almost certainly will be presented to the court, but the justices would not necessarily have to rule on it.

The other issue the high court will take on involves a provision of the Defense of Marriage Act, known by its acronym DOMA, which defines marriage as between a man and a woman for the purpose of deciding who can receive a range of federal benefits.

Four federal district courts and two appeals courts struck down the provision.

The justices chose for their review the case of 83-year-old Edith Windsor, who sued to challenge a $363,000 federal estate tax bill after her partner of 44 years died in 2009.

Windsor, who goes by Edie, married Thea Spyer in 2007 after doctors told them that Spyer would not live much longer. She suffered from multiple sclerosis for many years. Spyer left everything she had to Windsor.

There is no dispute that if Windsor had been married to a man, her estate tax bill would have been $0.

The 2nd U.S. Circuit Court of Appeals in New York agreed with a district judge that the provision of DOMA deprived Windsor of the constitutional guarantee of equal protection.