Mayor Adrian M. Fenty will sign legislation Friday to legalize same-sex marriage in the District at a bill-signing ceremony so historic that his staff scrambled to find the perfect location Thursday.

Would it be All Souls Unitarian Church, a Northwest house of worship known for its diversity, liberalism and welcoming of same-sex couples? Would it be Covenant Baptist Church, a predominantly black church in Southwest where husband-and-wife team of Dennis and Christine Wiley serve as co-pastors and support gay marriage? Or would it be a secular site?

Late in the day, Katie Loughary, executive director at All Souls, said it appeared that Covenant was winning. "We're disappointed, yes," she said. "But we're excited that it's happening."

But the letdown was turned around when the Rev. Robert Hardies, All Souls' senior pastor, said that he had been contacted by the mayor's office and told that his church would be the spot.

"We're honored to be able to host this historic bill-signing," he said. "We believe this is a historic step forward for justice and human rights in our nation's capital."

All Souls is ideal, said D.C. Council member Jim Graham (D-Ward 1). "It's great that he's chosen one of the key churches in this struggle, rather, in this victory, in the most diverse ward in the city," said Graham, one of two openly gay council members. "I'm so excited." The church is in Ward 1.

Hardies is co-chairman of D.C. Clergy United for Marriage Equality, a coalition of ministers founded this year to counter a group of clergy opposed to same-sex marriage. The Wileys were also leaders in the group, and Covenant would have been a symbolic choice -- it is in Ward 8, which is represented by council member Marion Barry, who dissented when the council voted 11 to 2 on Tuesday to legalize gay marriage.

Hardies said Fenty's decision to sign the bill in a church was telling. "This is symbolic of the strong religious support for this bill in D.C.," he said, noting that more than 100 clergy members had signed a declaration in support of same-sex marriage.

The measure was opposed by other religious leaders. The Catholic Archdiocese of Washington has strongly opposed the bill, saying that its charitable arm might have to cancel its contract with the city to deliver social services.

After Fenty (D) signs the bill, the legislation will be subject to congressional review under Home Rule.