SAN FRANCISCO — The four plaintiffs in the U.S. Supreme Court case that overturned California’s same-sex marriage ban tied the knot Friday, just hours after a federal appeals court freed gay couples to obtain marriage licenses in the state for the first time in 4 1/2 years.

Attorney General Kamala Harris presided at the San Francisco City Hall wedding of Kris Perry and Sandy Stier as hundreds of supporters looked on and cheered. The couple sued to overturn the state’s voter-approved gay marriage ban along with Paul Katami and Jeff Zarrillo, who married at Los Angeles City Hall 90 minutes later with Mayor Antonio Villaraigosa presiding.

Jeff Chiu, APAttorney General Kamala Harris, right, officiates the wedding of Kris Perry, left, and Sandy Stier in San Francisco, Friday, June 28, 2013. Stier and Perry were married Friday, June 28, 2013, after a federal appeals court on Friday cleared the way for the state of California to immediately resume issuing marriage licenses to same-sex couples after a 4 1/2-year freeze.

Damian Dovarganes, APJeff Zarrillo, left, and Paul Katami, center, pose for photos after being married by Los Angeles Mayor Antonio Villaraigosa, Friday June 28, 2013 at City Hall in Los Angeles.

“By joining the case against Proposition 8, they represented thousands of couples like themselves in their fight for marriage equality,” Harris said during Stier and Perry’s brief ceremony. “Through the ups and downs, the struggles and the triumphs, they came out victorious.”

Harris declared Perry, 48, and Stier, 50, “spouses for life,” but during their vows, the Berkeley couple took each other as “lawfully wedded wife.” One of their twin sons served as ring-bearer.

Although the couples fought for the right to wed for years, their nuptials came together in a flurry when a three-judge panel of the 9th U.S. Circuit Court of Appeals issued a brief order Friday afternoon dissolving a stay it had imposed on gay marriages while the lawsuit challenging the ban advanced through the courts.

Sponsors of California’s same-sex marriage ban, known as Proposition 8, also were caught off-guard and complained that the San Francisco-based 9th Circuit’s swift action made it more difficult for them to ask the Supreme Court to reconsider its decision.

Under Supreme Court rules, the losing side has 25 days to ask the high court to rehear the case, and Proposition 8′s backers had not yet announced whether they would do so.

“The resumption of same-sex marriage this day has been obtained by illegitimate means. If our opponents rejoice in achieving their goal in a dishonorable fashion, they should be ashamed,” said Andy Pugno, general counsel for a coalition of religious conservative groups that sponsored the 2008 ballot measure.

“It remains to be seen whether the fight can go on, but either way, it is a disgraceful day for California,” he said.

The Supreme Court ruled 5-4 Wednesday that Proposition 8′s sponsors lacked standing in the case after Harris and Gov. Jerry Brown, both Democrats, refused to defend the ban in court.

The decision lets stand a trial judge’s declaration that the ban violates the civil rights of gay Californians and cannot be enforced.

The Supreme Court said earlier this week that it would not finalize its ruling in the Proposition 8 case “at least” until after the 25-day period, which ends July 21.

The appeals court was widely expected to wait until the Supreme Court’s judgment was official. Ninth Circuit spokesman David Madden said Friday that the panel’s decision to act sooner was “unusual, but not unprecedented,” although he could not recall another time the appeals court acted before receiving an official judgment from the high court.

The panel — Judge Stephen Reinhardt, who was named to the 9th Circuit by President Jimmy Carter and has a reputation as the court’s liberal lion; Judge Michael Daly Hawkins, an early appointee of President Bill Clinton; and Judge Randy Smith, the last 9th Circuit judge nominated by President George W. Bush — decided on its own to lift the stay, Madden said.

Its order read simply, “The stay in the above matter is dissolved effective immediately.”

Vikram Amar, a constitutional law professor at the University of California, Davis, said the Supreme Court’s 25-day waiting period to make its decisions final isn’t binding on lower courts.

“Some people may think it was in poor form, But it’s not illegal,” Amar said. “The appeals court may have felt that this case has dragged on long enough.”

The same panel of judges ruled 2-1 last year that Proposition 8 was unconstitutional, but it kept same-sex marriages on hold while the case was appealed. But when the Supreme Court decided Proposition 8′s backers couldn’t defend the ban, it also wiped out the 9th Circuit’s opinion.

Proposition 8 passed with 52 percent of the vote in November 2008, 4 1/2 months after same-sex marriages commenced in California the first time. The Williams Institute, a think tank at the University of California, Los Angeles, estimates 18,000 couples from around the country got married in the state during that window.

Shortly after the appeals court issued its order Friday, the governor directed California counties to resume performing same-sex marriages. A memo from the Department of Public Health said “same-sex marriage is again legal in California” and ordered county clerks to comply by making marriage licenses available to gay couples.

Given that word did not come down from the appeals court until mid-afternoon, most counties were not prepared to stay open late to accommodate potential crowds. The clerks in a few counties announced that they would stay open a few hours late Friday before reopening Monday.

A jubilant San Francisco Mayor Ed Lee announced that same-sex couples would be able to marry all weekend in his city, which is hosting its annual gay pride celebration.