The Supreme Court cleared the way Wednesday for same-sex marriages in California, declining to rule on the state’s Proposition 8, which defined marriage as between one man and one woman.

The court ruled 5 to 4 that those who appealed a decision throwing out the constitutional amendment did not have legal standing to proceed. Thus, the Supreme Court did not rule on the merits of the case.

Only California officials may challenge a federal judge’s decision that Proposition 8 was unconstitutional, Chief Justice John G. Roberts Jr. wrote, and they decided against it. The challenge at the Supreme Court was brought by those who favored Proposition 8.

“We have never before upheld the standing of a private party to defend the constitutionality of a state statute when state officials have chosen not to,” Roberts wrote. “We decline to do so here.”

The four dissenters were justices who would probably disagree on the merits of the case but thought the court should hear them.

Liberal Justice Sonia Sotomayor and conservative Justices Clarence Thomas and Samuel A. Alito Jr. joined Justice Anthony M. Kennedy in objecting. They said the initiative process is worthless if state officials can simply refuse to enforce what the people have voted for.

In an earlier ruling on Wednesday morning, the court struck down as unconstitutional a key element of the 1996 Defense of Marriage Act, which denies federal benefits to same-sex couples who are legally married in the states where they reside.

Just hours after the ruling in the Proposition 8 case, California Gov. Jerry Brown announced via Twitter that his state will soon begin issuing marriage licenses to gay couples.

Gay rights advocates had mounted an expensive and groundbreaking legal challenge to a decision by California voters in 2008 to amend the state constitution to prohibit same-sex marriage. The move followed a decision by the state Supreme Court that same-sex unions must be allowed.

Proposition 8 was passed by California voters in 2008 after the state’s top court ruled 5 to 4 that such unions must be allowed. About 18,000 couples were married after the decision and before Proposition 8 was approved, and those marriages remain valid.

Challengers have been successful. U.S. District Judge Vaughn Walker ruled broadly that the initiative was unconstitutional. A decision from the U.S. Court of Appeals for the 9th Circuit was more narrow, also overturning Proposition 8 but in a way that limited the impact to California.

The U.S. Supreme Court’s action threw out that 9th Circuit decision, saying the appeal was not properly before it, and allowed Walker’s ruling to stand.

When the lawsuit that led to Walker’s ruling was filed four years ago, only three states allowed same-sex marriage.

Now, 12 states and the District of Columbia sanction same-sex marriages, and most polls show that a majority of Americans support the unions. Those younger than 30 overwhelmingly favor it.

It is also difficult now to remember how controversial it was when Theodore Olson and David Boies, adversaries at the Supreme Court in Bush v. Gore, teamed up to challenge the California constitutional amendment.

Even staunch supporters of same-sex marriage thought bringing to the Supreme Court a lawsuit that argued for a constitutional right to marriage for gays could bring a setback that could take years to overcome.

But many now argue that the national debate over same-sex marriage contributed to some of the movement’s greatest successes. Although the idea is deeply unpopular in parts of the country, especially the South, voters for the first time endorsed same-sex marriage at the ballot box in three states, including Maryland.