SAN FRANCISCO—Gay rights groups in California plan to ask voters to overturn the ban on same-sex marriage they approved last week if legal challenges to Proposition 8 are unsuccessful.

In an e-mail to supporters, Equality California executive director Geoffrey Kors said Wednesday that he and other gay marriage advocates are aiming for a ballot initiative to reverse the ban in two years.

Proposition 8, a constitutional amendment that overruled the California Supreme Court that legalized same-sex marriage, passed 52 percent to 48 percent.

Couples who missed the chance to wed and others have filed petitions asking the court to throw out the measure on the grounds that voters did not have authority to enact such a sweeping constitutional change.