Maryland's highest court handed a victory to same-sex couples Friday in a ruling that the governor and other advocates hailed as an endorsement of administration policies recognizing gay marriages performed in other states.

"To treat families differently under the law because they happen to be led by gay or lesbian couples is not right or just," Gov. Martin O'Malley said in a statement. "Today's decision is another step forward in our efforts to ensure that every child is protected equally under the law."

However, the ruling, in a case over whether Maryland courts could grant divorces to same-sex spouses, met with skepticism from groups fighting a recently passed state law legalizing gay nuptials.

Mathew Staver, founder and chairman of Liberty Counsel, a conservative international legal group, said the ruling "did not extend beyond divorce at this stage."

"I think the decision is flawed, because if Maryland does not recognize same-sex marriage … then the courts don't have the authority to either solemnize it or dissolve it," Staver said. "It shouldn't be recognized for any purpose, including the dissolution."

The case arose after Jessica Port and Virginia Anne Cowan, who were married in California, appealed the denial of their uncontested divorce in Prince George's County. Before Friday's ruling, judges in Maryland have variously granted or denied divorces for same-sex couples.

"It's great news. It's great for the state of Maryland, and it's great for me," said Port, 29.

Cowan, 32 could not be reached for comment.

Michele Zavos, an attorney who represents Cowan, called the court's action "a game-changer in Maryland." The Court of Appeals' unanimous decision, she said, means that married same-sex couples will have "the same rights as every couple in Maryland."

Maryland Attorney General Douglas F. Gansler, who supports same-sex marriage, said the decision will affect not only the dissolution of gay marriages performed out of state but will provide same-sex spouses with other legal protections that married couples enjoy.

The 21-page ruling does not affect the pending gay marriage law or the potential referendum on it, attorneys said.

The General Assembly passed legislation this year allowing same-sex weddings to be performed in the state, and it is scheduled to take effect in January. Opponents are trying to put the measure on the November ballot in hopes that voters will overturn it.

Opponents shook their heads over the Court of Appeals decision.

The Rev. Derek McCoy, executive director of the Maryland Marriage Alliance, part of a coalition seeking a referendum on the new law, said more than two-third of the signatures needed to have the measure placed on the ballot have been collected.

He called Friday's ruling "merely an example of how the courts and the legislature continue to be out of step with the clear will of the people."

Even if the law were to be overturned in the referendum, same-sex couples from Maryland who were wed outside the state still would return home married, said Mark Scurti, a lawyer for Port.

"That just means folks will go elsewhere to get married," Scurti said. "You are basically letting dollars go south to D.C. or north to other jurisdictions."

Port said she and Cowan decided to appeal after learning what a favorable ruling in Maryland might produce, she said. They could have filed in Washington, where Cowan relocated.

Because marriage laws vary from state to state and federal law does not force states to recognize same-sex marriages performed elsewhere, the inability to divorce can lead to odd situations. Port or Cowan could have married a man in Virginia, which does not recognize same-sex marriages, but could not have married anyone in New York without being labeled a bigamist, lawyers said.