Updated

California Gov. Arnold Schwarzenegger (search) has ordered the state's attorney general to take legal action to put an end to San Francisco's granting of marriage licenses to gay couples.

Schwarzenegger's directive to Attorney General Bill Lockyer (search) was sparked in part by a judge's decision on Friday not to impose a temporary restraining order that would have halted San Francisco's weeklong parade of 3,175 same-sex weddings, said Rob Stutzman (search), Schwarzenegger's communications director.

"Our civilized society and legal system is based upon a respect for and adherence to the rule of law," Schwarzenegger wrote in a letter to Lockyer. "The City and County of San Francisco's unfortunate choice to disregard state law and grant marriage certificates to gay couples directly undermines this fundamental guarantee."

The Republican governor "feels that we've come to a point where we're starting down a dangerous path and it leads to anarchy at some point," Stutzman said. "It's time for this to end."

Lockyer, an elected Democrat who is a potential candidate in the 2006 governor's race, has said he plans to vigorously defend state laws barring gay marriage.

Judge Ronald Evans Quidachay (search) denied the Campaign for California Families' request for a temporary restraining order Friday, saying conservative groups failed to prove same-sex weddings would cause irreparable harm. In a separate case, another judge declined to order an immediate stop to the marriages Tuesday.

The conservative group argued that the weddings harmed all the Californians who voted in 2000 for Proposition 22, which defined marriage as between a man and a woman.

The judge suggested that the rights of the gay and lesbian couples appeared to be more substantial.

"If the court has to weigh rights here, on the one hand you are talking about voting rights, and on the other you are talking about equal rights," Quidachay said.

Quidachay consolidated the Campaign for California Families' lawsuit against the city with one filed by another conservative group, and told lawyers for both sides to work out between themselves when the next hearing would be held.

Peter Ragone, spokesman for San Francisco Mayor Gavin Newsom, scoffed at Schwarzenegger's directive.

"The truth is, thousands of people are involved in loving relationships and having them recognized for the first time," Ragone said. "We urge the governor to meet with some of the couples because what's happening is both lawful and loving."

Mathew Staver, a lawyer representing the Campaign for California Families, said he believes the court ultimately will find that Newsom acted illegally when he began allowing gay marriages last week.

"He can't decide to grant same-sex marriage licenses any more than he can declare war against a foreign country," Staver said.

But chief deputy city attorney Therese Stewart said the failure of conservative opponents to win emergency injunctions demonstrates that the city has a strong case.

"Both judges really recognized there is nobody who is hurt by allowing gay people to marry," Stewart said.

Newsom remained defiant before the ruling, officiating at the wedding of one of California's most prominent lesbian politicians inside his offices at City Hall.

A crowd of politicians and lawyers celebrated that wedding as other gays and lesbians prepared to join the more than 3,000 same-sex couples allowed to marry so far.

About 25 anti-gay-marriage protesters later blocked the door of the county clerk's office, lying down in front of the line and singing religious songs. Gays and lesbians responded by belting out "The Star-Spangled Banner" until sheriff's deputies escorted the protesters out. No arrests were made.

Most Americans remain opposed to same-sex marriages. A poll out Friday indicated that 50 percent of Californians remain opposed, but that sympathy for allowing gays and lesbians to marry has risen by 6 percentage points over the last four years, to 44 percent.

In the San Francisco Bay area, 58 percent of all respondents support gay marriage, according to the Public Policy Institute of California poll, which was based on a statewide survey taken Feb. 8-16 and has a margin of error of 2 percentage points.

While defending its new marriage policy in court, the city also is suing the state, challenging its gay-marriage ban. The city contends the ban violates the equal protection clause of the California Constitution.

The Associated Press contributed to this report.