The United Methodist Church is expected to split into two denominations in an attempt to end a years-long, contentious fight over same-sex marriage, church leaders announced Friday. The historic schism would divide the nation’s third-largest religious denomination.

Leaders of the church said they had agreed to spin off a “traditionalist Methodist” denomination, which would continue to oppose same-sex marriage and to refuse ordination to LGBT clergy, while allowing the remaining portion of the United Methodist Church to permit same-sex marriage and LGBT clergy for the first time in its history.

The plan would need to be approved in May at the denomination’s worldwide conference.

The writers of the plan called the division “the best means to resolve our differences, allowing each part of the Church to remain true to its theological understanding, while recognizing the dignity, equality, integrity, and respect of every person.”

The United Methodist Church is the United States’s largest mainline Protestant denomination. The church has fought bitterly about LGBT inclusion for years, and leaders often feared the fight would lead to a schism.

“I’ve always been committed to unity. But over time, it could not be unity at someone’s expense,” said Bishop Kenneth Carter, president of the church’s Council of Bishops and one of the formulators of the new plan.

The plan was praised by conservatives and progressives within the church.

Jan Lawrence, executive director of the Reconciling Ministries Network, a pro-LGBT group within the church, said the separation plan “gives the hope that we can move toward a church that allows healing to begin.”

The split is “a resolution that’s going to free the Methodist church to share love unconditionally with all people,” said Andrew Ponder Williams, a married gay candidate for the clergy who was a member of earlier committees that attempted to resolve the issue.

The Rev. Thomas Lambrecht, vice president of the conservative Methodist organization Good News, also praised the plan: “We believed that separation was the only feasible way of resolving our conflict in the church and allowing different groups in the church to pursue ministry as they believe coincides with their understanding of the Christian faith.”

Friday’s announcement came as new sanctions were set to go into effect in the church, which would have made punishments for United Methodist Church pastors who perform same-sex weddings much more severe: one year’s suspension without pay for the first wedding and removal from the clergy for any wedding after that.

Instead, leaders from liberal and conservative wings signed an agreement saying they will postpone those sanctions and instead vote to split at the worldwide church’s May general conference.

They said the agreement was brokered by Kenneth Feinberg, the mediation expert who handled the compensation fund for victims of the 9/11 terrorist attacks, among other major negotiations.

The agreement pledges $25 million to the new “traditionalist” denomination, which will break away from the United Methodist Church. In exchange, Friday’s announcement said, the new denomination would drop any claim to United Methodist assets, such as church-owned agencies.

Any local church that wants to join the new conservative denomination would have to conduct a vote within a specified time frame, the announcement said. A church would not need to vote to remain United Methodist. Churches that vote to leave could take certain assets with them, including their local church buildings in some cases.

An additional $2 million would go to any other new denomination that wishes to split from the church. The plan also calls for $39 million “to ensure there is no disruption in supporting ministries for communities historically marginalized by racism.”

After the separation, the agreement said, the remaining United Methodist Church would hold another conference with the purpose of removing the church’s bans on same-sex marriage and LGBT clergy. Some advocates for LGBT inclusion worried that simply removing prohibitions would not be enough.

“There are efforts in the protocol to stop condemnation of LGBTQ people, which of course is good. There are no signs pointing toward a church that affirms us and repents of the significant harm that has been done to LGBTQIA people for decades because of its complicity in spiritual violence against us,” said M Barclay, who was ordained in 2017 as the United Methodist Church’s first transgender deacon.

Barclay said the agreement does not put in place protections against discrimination of LGBT clergy.

The 16 members of the negotiating team that reached the plan included bishops from New York, Florida, Louisiana, Ohio, the Philippines and Sierra Leone. The team also included leaders from the most pro-LGBT Methodist factions, including the Reconciling Ministries Network, and the most conservative, including the Wesleyan Covenant Association and the Good News movement.

Conservative and liberal church leaders said they expect the agreement to pass in May, but some disagreed on which side African churches will join. The agreement allows an option in which African churches might be permitted to make their own decision on LGBT inclusion, apart from the U.S. church’s steps.

“The church in Africa has been the strongest voice for unity,” Carter said, arguing that African churches will remain in the United Methodist Church, which has ministries on the continent. “Mission in the African context is life and death. It’s not ideological. It’s water. It’s education. It’s food.”

Conservatives theorized the African churches will instead go with the traditionalist camp, since they will oppose the American church’s newly liberal beliefs on sexuality.

American Protestants are generally divided into three theological and cultural camps: evangelical churches, which almost unanimously oppose same-sex marriage and view gay conduct as sinful based on their reading of the Bible; historically African American denominations, which are more divided on the issue; and mainline Protestant churches, which tend to be both theologically and politically more liberal. Though mainline churches have a deep history in America – most of the Founding Fathers and most presidents since have been mainline Protestants – Pew Research Center’s 2014 count found that less than 15 percent of Americans now identify with mainline churches, while 25 percent are evangelical and 20 percent are Catholic.

Many mainline denominations, including the Episcopal Church, Presbyterian Church (U.S.A.), Evangelical Lutheran Church in America, United Church of Christ and others, already perform same-sex marriages and appoint gay clergy. But the United Methodist Church has fought bitterly over the issue, to the point that leaders have feared a schism over the issue for years.

In part, that reflects political division in the United States: American Methodists are more conservative than other mainline Protestants. Pew Research Center found in 2014 that 54 percent lean Republican and 35 percent lean Democrat, a significantly more Republican tilt than other mainline denominations. Fifteen percent of Methodists describe themselves as “liberal,” compared with 22 percent of mainline Presbyterians, 24 percent of mainline Lutherans and 29 percent of Episcopalians.

But the larger divide is between American Methodists and foreign members of the United Methodist Church, especially churches in Africa. In a church that conducts all of its major decisions in churchwide votes, the much more conservative-leaning voters from Africa competed with American delegates who often fervently pushed for a change on same-sex marriage.

At a conference last year where church leaders had declared they would solve this issue, many American delegates favored a plan that would have allowed local churches to make their own decisions on whether to perform same-sex marriages and ordain gay clergy. Some supported a plan to simply allow same-sex marriages worldwide. They were stunned when a third option passed, instead – one dubbed the “Traditional Plan,” which ushered in not only a continued ban on LGBT weddings and clergy, but also harsher penalties for those who disobey church doctrine.

Resistance to the vote began almost immediately. Groups of clergy met in several cities in recent months to formulate options.

For some LBGT Methodists, Friday’s news arrived too late. Williams, who worked on earlier negotiations, is pursuing ordination in the United Church of Christ instead of the United Methodist Church.

“The temptation is to worry about the people screaming, ‘I’m leaving. I’m done. I can’t do this anymore,’ ” he said. “But for every one of those, there are 10 people respectfully, ethically and quietly exiting themselves and going somewhere new. That has been the past year for a lot of LGBTQ people and allies.”

Conservative leaders said they realized they could not compel their peers to agree with their understanding of biblical morality.

“Some would say we should hold on to them to help steer them in the right direction, but you can’t keep anyone a prisoner,” said Mark Tooley, of the Institute on Religion and Democracy, which advocates for biblical orthodoxy. “The good news is, in the end, everyone is going to end up in a church where they want to be.”