LOS ANGELES — The Supreme Court announced Friday it will rule for the first time on same-sex marriage by deciding the constitutionality of California’s Proposition 8, the voter initiative that limited marriage to a man and a woman.

The justices also said they would decide whether legally married gay couples have a right to equal benefits under federal law.

The California case raises the broad question of whether gays and lesbians have an equal right to marry.

If the justices had turned down the appeal from the defenders of Prop. 8, it would have allowed gay marriages to resume in California, but without setting a national precedent.

Now, the high court has agreed to decide whether a state’s ban on same-sex marriages violates the U.S. Constitution. The court’s intervention came just one month after voters in three states—Maine, Maryland and Washington—approved gay marriages. This brought the total to nine states having legalized same-sex marriages.

But the justices also left themselves a way out. They said they would consider whether the defenders of Prop. 8 had legal standing to bring their appeal.

The justices made the announcement after meeting behind closed doors. They did not say which justices voted to hear the appeals.

Last year, the U.S. 9th Circuit Court of Appeals struck down Prop. 8, but it did so on a narrow basis. Judge Stephen Reinhardt reasoned that the voter initiative was unconstitutional because it took away from gays and lesbians a right to marry that they won before the state supreme court.

The justices now will have at least three options before them. First, they could reverse the 9th Circuit and uphold Prop. 8, thereby making clear that the definition of marriage will be left to the discretion of each state and its voters.

They could rule broadly that denying gays and lesbians the fundamental right to marry violates the Constitution’s guarantee of equal protection of the laws. Such a decision would open the door to gay marriages nationwide.

Or as a third option, they could follow the approach set by the 9th Circuit and strike down Prop. 8 in a way that limits the ruling to California only.

In the other gay-marriage cases, the court will decide the constitutionality of part of the Defense of Marriage Act which denies federal benefits to legally married couples. Judges in New England, New York and California have ruled this provision unconstitutional.

The justices are expected to hear arguments in the two sets of gay marriage cases in March and issue decisions by late June.