The city of San Francisco asked a judge Thursday for permission to intervene in the federal lawsuit challenging California's ban on same-sex marriage, a request that may intensify the battle for control of the high-stakes litigation.

The leader of an organization that filed the suit against Proposition 8 has already accused established gay-rights groups of trying to undermine the case and promised to oppose their attempt to intervene. San Francisco raised the stakes Thursday by filing a similar motion with Chief U.S. District Judge Vaughn Walker, who has scheduled a hearing for Aug. 19.

The city would add "a unique local government perspective" to the case, along with its extensive legal experience in defending gay and lesbian rights, if allowed to intervene, City Attorney Dennis Herrera's office said in court papers.

The city and leading gay-rights groups have been allowed to file written arguments supporting the challenge to Prop. 8. But only the plaintiffs -two couples and an organization represented by attorneys Theodore Olson and David Boies, adversaries in the 2000 Bush vs. Gore presidential election case - have the right to direct the case, negotiate with defenders of Prop. 8 and file appeals.

The state Supreme Court upheld Prop. 8 in May as a state constitutional amendment overturning the court's year-old ruling that recognized same-sex marriage in California. Several days before the latest ruling, Olson and Boies filed their federal suit, arguing that Prop. 8 violated the U.S. Constitution's guarantee of equal protection of the law.

Gay-rights advocates and the city of San Francisco, plaintiffs in the state court case against Prop. 8, had steered clear of federal issues that might have given the U.S. Supreme Court jurisdiction to rule on same-sex marriage. Now that the dispute is in federal court, however, the state plaintiffs want to join the argument but redefine the case.

Rather than simply claiming a constitutional right to same-sex marriage, the city and the advocacy groups argue that Prop. 8, by taking rights away from gays and lesbians, is a discriminatory measure that violates federal standards. Walker showed interest in that argument when he issued an order this month asking for evidence on the purpose and effects of Prop. 8 and suggesting the case should go to trial.

When gay-rights groups responded to the judge's order by asking to intervene as full-fledged plaintiffs, Chad Griffin, president of the American Foundation for Equal Rights - a recently formed organization that is funding the Olson-Boies suit and is already a plaintiff - published a letter accusing those groups of trying to sabotage the case.

Herrera's office, in today's filing, said the city has tried to build "a strong and positive relationship" with lawyers for the plaintiffs and would work cooperatively if allowed to intervene.