LOS ANGELES - Opponents of gay marriage filed a long-shot petition on Saturday with the U.S. Supreme Court asking the justices to immediately halt same-sex weddings taking place in California since Friday, when an appeals court lifted a five-year-old ban on gay matrimony.

Marriage ceremonies of gay and lesbian couples went ahead after a three-judge panel of the 9th U.S. Circuit Court of Appeals in San Francisco removed its stay of a trial judge's order declaring the gay marriage ban, known as Proposition 8, unconstitutional.

The stay had been in force while the decision striking down Prop 8, a state constitutional amendment passed by voters in 2008, was appealed to the Supreme Court. Political supporters of the measure were left to appeal the case because state elected officials declined to defend it.

But the justices on Wednesday ruled Prop 8 proponents lacked legal standing to defend the ban, a decision that left the trial judge's ruling intact and paved the way for gay marriage in the state to resume.

The Supreme Court had said its ruling would not go into effect for at least 25 days, the amount of time normally given the losing party, in this case, Prop 8 backers, to seek a rehearing of the matter.

But California Attorney General Kamala Harris publicly urged the appeals court to lift its stay sooner than that, and on Friday the 9th Circuit did so in a surprise move that prompted a flurry of hastily arranged same-sex weddings up and down the state.

Harris herself officiated the very first one, a ceremony in which one of the two couples named as plaintiffs in the lawsuit against Prop 8, Kristin Perry and her fiancée, Sandy Stier, exchanged vows on a balcony overlooking the grand staircase at San Francisco City Hall.

Dozens more couples lined up on Saturday at City Hall as officials kept the doors open to accommodate gay and lesbian couples eager to tie the knot.

The scene was upbeat but subdued, with many couples casually dressed as they waited to obtain marriage licenses. The calm was punctuated about every 15 minutes by loud clapping when a wedding ended, as family and friends of a newly wedded couple joined in applause with marriage license applicants.

City Administrator Naomi Kelly said at least one couple came from as far away as Texas.

One pair of San Francisco newlyweds, Ken and David Miller, who have been together for 24 years, said they decided to seize the moment on Saturday out of concern that the window for same-sex nuptials could somehow close again.

"We knew how the courts can play games and pull the plug," said Ken Miller, 60. "But the courts are closed over the weekend and the city was open, so we thought we should do it."

In their application asking the Supreme Court to overrule the 9th Circuit and reinstate the gay marriage ban, opponents argued the appeals court had jumped the gun in lifting its stay.

The Arizona-based group Alliance Defending Freedom argued that the 9th Circuit lacked authority to act when it did, and that it violated the terms of its own stay requiring the ruling remain in place "until final disposition by the Supreme Court."

'WEAK ARGUMENT'

But the American Foundation for Equal Rights, which sponsored the federal court challenge to Prop 8, issued a statement insisting the 9th Circuit acted under its own "broad discretion" to issue its stay in the first place.

"Now that the Supreme Court has decided that the injunction against Proposition 8 must stand, it was entirely appropriate for the 9th circuit to dissolve its stay of that injunction," the alliance said in a statement.

Foundation lawyer Ted Boutrous said Friday's move was hardly unprecedented and that appeals courts had acted similarly in previous, lower-profile cases without drawing attention. Prop 8 supporters, he said, "should hang it up and quit trying to stop people from getting married."

Margaret Russell, a constitutional law professor at Santa Clara University School of Law in California, told Reuters the petition by Prop 8 backers had little chance of success.

"The 25 days isn't a final date. It's a period of time, and the 9th Circuit has the right, actually, to act within the 25 days," Russell said. "They lost the case, so I think that's a weak petition and a weak argument."

Daria Roithmayr, a University of Southern California law school professor, said she expected the petition to be dismissed.

With the federal appeals court action on Friday, California became the 10th state, in addition to the District of Columbia, where gay marriage is legal. Laws legalizing same-sex marriage are due to go into effect in the coming weeks in three more states - Delaware, Rhode Island and Minnesota.

About 18,000 gay couples were previously married in California during a five-month window in 2008 after the state Supreme Court swept aside an earlier ban but before Prop 8 was passed in November of that year.

In August 2010, then-U.S. District Judge Vaughn Walker declared Prop 8 unconstitutional following a three-week trial that marked the first challenge in federal court to any state law barring same-sex matrimony. It was his injunction against further enforcement of Prop 8 that had remained stayed by the appeals court pending resolution of the case.

The renewed tolling of wedding bells for same-sex couples in California capped a historic week for gay rights nationwide. The Supreme Court on Wednesday also struck down a U.S. law that denied various federal benefits to married gay couples.