WASHINGTON — The Supreme Court will take on the issue of gay marriage next year on two critical fronts: In one case it will decide whether same-sex married couples can be deprived of federal benefits, and in another it will review a state ban on same-sex marriage, raising the possibility it will find all such bans unconstitutional.

The nation’s highest court agreed Friday to review an appeals court decision that challenges the constitutionality of a 1996 federal law defining marriage as a union solely between one man and one woman, barring legally married gay couples from receiving federal benefits such as spousal disability, Social Security, and family medical leave.

The court will also take up California’s ban on same-sex marriage and review a federal appeals court ruling that struck down the ban.

Some legal experts said it is not surprising that the court would hear the case involving the federal Defense of Marriage Act since the Justice Department has sought a final ruling on the issue, but the experts had expected the court to let the California case stand because it was decided upon narrow grounds. The San Francisco-based US Court of Appeals for the Ninth Circuit said the state’s voters could not rescind a right that had been granted by California’s Supreme Court, but it did not rule out state bans altogether. That appeared to limit the reach of the case to California.

“It’s not like the Ninth Circuit was going to impose same-sex marriage on the whole nation,” said Linda McClain, a Boston University law professor and specialist in a family law and policy.

In the California case, the court could reverse the lower-court decision, letting the state ban stand. Or it could uphold the decision, ending the California ban, or it could find all such state bans unconstitutional. Hearings are expected in March, with a decision likely by June.

In the case challenging the Defense of Marriage Act, the Supreme Court chose to hear a New York case involving an 83-year-old widow forced to pay more than $363,000 in federal estate taxes after the death of her female spouse, because their marriage was not recognized under federal law. Had the marriage been between a man and a woman, estate tax would not have been owed.

‘Whatever the court rules will apply in any state that allows same-sex marriage.’

Even though it has refused to defend the law in the courts, the Justice Department has said it was compelled to continue enforcing the law and deny married same-sex couples federal benefits until the Supreme Court issued a decision.

The Justice Department wants finality, McClain said. “As more states pass laws allowing same-sex couples to marry, the issues around the Defense of Marriage Act become more and more relevant,” she said. “Whatever the court rules will apply in any state that allows same-sex marriage.”

The US appeals court in Boston in May granted equal federal benefits to same-sex couples in much of New England, making it the first court to do so, saying the Defense of Marriage Act violates the federal equal protection clause.

Mary Bonauto, a lawyer for Gay and Lesbian Advocates and Defenders, a Boston-based advocacy group, had challenged the federal law on behalf of 17 plaintiffs. She said Friday, “There’s no doubt that the Massachusetts case really set the standard for how to handle these cases.”

Advocates for gay marriage say the Supreme Court may have chosen to hear the New York case over Massachusetts to avoid a potential conflict of interest with Justice Elena Kagan, who was the Obama administration’s solicitor general at the time and admitted to discussing the Massachusetts case. Kagan would probably have had to recuse herself had the Massachusetts case had been selected.

Bonauto, who successfully argued for the rights of gays to marry in Massachusetts in 2003, said she is “delighted we are moving toward resolution of some of the very important questions that affect families of same sex couples.”

“We are talking about people who are hardworking, tax-paying people who are simply asking . . . to be treated like all other people who are legally married by their states,” Bonauto said.

A state organization that has advocated against gay marriage, the Massachusetts Family Institute, said it hopes the Supreme Court will uphold both the Defense of Marriage Act and the California ban on same-sex marriage.

“At issue in these cases is, ultimately, the question of whether the government has a right to protect traditional marriage,” said the group’s executive vice president, Andrew Beckwith. “Just last week, a court in Nevada ruled that it did. That is the position Massachusetts Family Institute argued in our brief in the First Circuit Defense of Marriage Act case, and we are encouraged that the Supreme Court now has an opportunity to confirm it.”

Other opponents of gay marriage said Friday they are heartened by the Supreme Court’s action.

‘‘We believe that it is significant that the Supreme Court has taken the Proposition 8 [the California ban] case. We believe it is a strong signal that the court will reverse the lower courts and uphold Proposition 8. That is the right outcome based on the law and based on the principle that voters hold the ultimate power over basic policy judgments and their decisions are entitled to respect,’’ said John Eastman, chairman of the National Organization for Marriage and a law professor at Chapman University in Orange, Calif.

Nine states and the District of Columbia have approved same-sex marriage. But 31 states, most recently North Carolina, have amended their constitutions to bar same-sex marriage.

Representative Barney Frank of Massachusetts, who married his longtime partner, Jim Ready, in July, said Friday, “I am optimistic in both cases. We are simply asking the Supreme Court to apply principles it has already applied: You can’t choose among people and you can’t take rights away from people. . . . There is zero negative effect of same-sex marriage on anybody who didn’t choose to be in one.”

Herb Burtis, 82, of Sandisfield, learned he would be deprived of federal benefits following the death of his husband, John Ferris, in 2008 of Parkinson’s disease. They met when Burtis was 18 and married in 2004, following Massachusetts’ landmark decision.

“I have been waiting for 64 years for this to happen,” Burtis said of the high court’s decision to take up gay marriage, and said he found it unfair that upon his husband’s death, he would be denied benefits that heterosexual married couples automatically receive.

Massachusetts Attorney General Martha Coakley said in a statement Friday that she hopes “the Supreme Court will decide, once and for all, that [the Defense of Marriage Act’s] discrimination is unjustifiable and wrong.”

“We look forward to the time when that discriminatory law is conclusively invalidated,” Coakley said.

President Obama, who in May became the first president to speak out in favor of gay marriage, did not comment publicly on the issue Friday.

BostonGlobe.com complimentary digital access has been provided to you, without a subscription, for free starting today and ending in 14 days. After the free trial period, your free BostonGlobe.com digital access will stop immediately unless you sign up for BostonGlobe.com digital subscription. Current print and digital subscribers are not eligible for the free trial.

Thanks & Welcome to Globe.com

You now have unlimited access for the next two weeks.

BostonGlobe.com complimentary digital access has been provided to you, without a subscription, for free starting today and ending in 14 days. After the free trial period, your free BostonGlobe.com digital access will stop immediately unless you sign up for BostonGlobe.com digital subscription. Current print and digital subscribers are not eligible for the free trial.