SAN FRANCISCO -- The Episcopal Diocese of California averted another churchwide showdown over the role of gays in their denomination when delegates rejected three gay candidates for bishop yesterday.
The diocese chose the Right Rev. Mark Handley Andrus of Birmingham, Ala., on the third ballot to replace the retiring Rev. William Swing. None of the gay candidates received more than a handful of votes.
The packed Grace Cathedral erupted with cheering and applause when the announcement was made.
The vote was closely watched by Episcopalians across the nation and their fellow Anglicans worldwide, who have been struggling to remain unified despite deep differences over gay clergy.
The 77 million-member Anglican Communion, represented in the United States by the Episcopal Church, is still reeling from the 2003 election of the first openly gay Episcopal bishop: V. Gene Robinson of New Hampshire.
Episcopalians differ over whether the Bible permits ordaining gays but agreed that choosing a second leader in a same-sex relationship would severely damage relations within the global Communion.
In 2004, Anglican leaders trying to keep the Communion from splitting asked the US church for a temporary moratorium on electing gay bishops. Those supporting a greater role for gays and lesbians believe it is unfair to ask them to wait, and they question whether any reconciliation can occur when opposing sides have such conflicting views of Scripture.
Andrus emerged as the favorite among clergy delegates in the first ballot and quickly drew the support of lay voters in subsequent ballots. After four hours, he ended up with 72 percent of the clergy vote and about 55 percent of the lay vote.
Andrus, who has served as bishop suffragan in the Diocese of Alabama since 2001, received his master's of divinity in 1987 from the Virginia Theological Seminary in Alexandria, Va. He is married and has two college-age daughters.
In a statement to California Episcopalians before his election, he said he found them ''people of passion and energy, commitment, faith, and humor. You are able to appreciate yourselves, and be self-critical, both rare qualities."
The gay candidates were the Rev. Canon Michael Barlowe of San Francisco, the Very Rev. Robert Taylor of Seattle, and the Rev. Bonnie Perry of Chicago. Perry, who is a graduate of Holy Cross College, withdrew her candidacy before the final vote. All three have same-sex partners.
Besides Andrus, the other nominees to succeed Swing were the Rev. Jane Gould of Lynn, Mass., the Rev. Donald Schell, of San Francisco; and the Rev. Canon Eugene T. Sutton, of Washington.
Gould, the 49-year-old rector at St. Stephen's Episcopal Church in Lynn, came in third in the election with 8 percent of the clergy vote and 10.8 percent of the lay vote.
While disappointed by her loss, Gould said she was impressed by the slate of candidates, whom she spent last week with.
''California will do well," said Gould, who received bachelor's and master's degrees at Stanford University, where she was a varsity field hockey player who helped the athletic department implement Title IX, the federal law that prohibits gender discrimination in schools, including sports.
''Mark's a great guy," she said. ''To be an advocate for gay and lesbian people in the south in the church, they have a man of substance, and courage and commitment. They elected someone who's been bold but passionately committed to unity in the church."
Gould has headed St. Stephen's since 2000. During that time, the church launched a weekly service in Kiswahili for its East African congregation, established a youth group for Latino teenagers from diverse religious backgrounds, and started a summer program for neighborhood children, most of whom are Dominican.
''I have regrets about not winning," Gould said yesterday in a phone interview from her son's baseball game. ''I have no regrets about staying at St. Stephen's. . . . I'm still in Lynn and life's good."
Gould was the Episcopal chaplain at MIT for seven years. She taught history and coach field hockey and lacrosse at Milton Academy and Phillips Academy in Andover. She lives in Andover with her husband, an English teacher at Phillips Academy. They have two sons, 21 and 17.
Nearly 600 delegates gathered for the election.
Before he is installed as bishop, Andrus must get approval from the denomination's top legislative body, the General Convention, which is set to meet June 13-21 in Columbus, Ohio. Delegates have a long history of deferring to dioceses' choice of leader.
Tracy Jan of the Globe staff contributed to this report.