NEW YORK — A provision that would have freed churches to make political endorsements has been dropped from the Republican tax overhaul, dashing the hopes of a segment of religious conservatives on what has been a key issue to the Trump administration.

Advocacy groups on opposing sides said Friday they expect lawmakers to keep trying to loosen rules over partisanship in the pulpit, even as this latest effort has reached a dead end.

Conservative groups such as the Family Research Council and the Alliance Defending Freedom have for years sought to abolish IRS rules that bar electioneering by houses of worship and other charitable groups. President Trump pressed the fight on the campaign trail and in the White House.

Still, only Congress has the authority to repeal the restriction known as the Johnson Amendment. It was named for President Lyndon Johnson, who introduced the measure in 1954 when he was a Democratic senator from Texas upset about a few nonprofit groups that had attacked him as a communist during a Senate race.

Under the IRS regulations, churches and other nonprofits can engage in a wide range of activity related to public issues, such as advocating for certain policies. However, pastors and churches are not allowed to endorse a particular candidate in a sermon or during church services without potentially losing their status as an organization exempted by the government from paying taxes. Even so, the IRS rarely enforces the rule.

The latest repeal effort was tucked into the Republican tax bill.

The House eliminated the restrictions for houses of worship and all nonprofits. The Senate bill did not include the provision, prompting a negotiation as a House-Senate committee worked to blend the two separate tax bills into a final package. The Senate parliamentarian decided the provision did not meet a Senate requirement that all parts of the bill be related to the budget.

Many religious groups want to keep the IRS restriction as is. They included the American Baptist Churches U.S.A., the Union for Reform Judaism, the Episcopal Church and the Seventh-day Adventist Church, which counts Housing and Urban Development Secretary Ben Carson as a prominent member.

The groups say repealing the provision could divide their congregations along political lines and fear potential pressure from congregants to endorse politicians.

“They seemed most concerned about what this would do to their houses of worship and the communities that they value so much,” said Amanda Tyler, president of the Baptist committee. “They talked about how politically and ideologically diverse their church families are and how this could really tear at the heart of the community and both distract and divert them from the reason they come together as a church.”

A February survey by the National Association of Evangelicals, which represents 40 denominations and thousands of churches, found 89 percent of evangelical leaders said pastors should not endorse politicians from the pulpit.

But Tony Perkins, president of the Family Research Council, said opponents want to keep “religious leaders and churches muzzled or at least intimidated into silence” and vowed to keep fighting “until we have legislatively corrected this injustice or found a remedy in court.”