WASHINGTON — President Trump on Thursday will ease restrictions on political activity by tax-exempt churches and charities, White House officials said, but has backed away from a broader religious liberty order that would have allowed faith-based organizations and companies to avoid serving or hiring gay people.

Conservative religious leaders who were fierce supporters of Mr. Trump’s candidacy had pushed the president to provide faith organizations with much more sweeping relief from Obama-era regulations that protect gay men, lesbians and others from discrimination.

Instead, in an executive order, Mr. Trump will offer a vague promise to “protect and vigorously promote religious liberty.” He will also direct federal agencies to exempt some religious organizations from Affordable Care Act requirements that provide employees with health coverage for contraception.

By making those promises to mark the National Day of Prayer at the White House, Mr. Trump is offering a partial remedy to the anger inside some religious communities toward federal laws they believe require them to put aside beliefs about homosexuality, contraception or other issues.

Mr. Trump’s executive order on political activity, which he will sign while hosting conservative religious leaders, tries to overcome a provision in the federal tax code that prohibits churches and other religious organizations from directly opposing or supporting political candidates.

Officials said Mr. Trump will direct the Internal Revenue Service to exercise “maximum enforcement discretion” so that religious organizations and other nonprofit groups are not subject to punishment for expressing political views during campaign seasons.

The move is likely to be hailed by some faith leaders who have long complained about ominous — but rarely enforced — threats from the I.R.S. that they could lose their tax-exempt status, costing them millions of dollars in fines. They said such actions unfairly stifle their voices.

Mr. Trump seized on the issue of limited political activism by religious leaders during the presidential campaign, winning cheers at rallies when he proclaimed that the tax code provision, known as the Johnson Amendment, denied pastors their right to free speech during elections.

“I will get rid of and totally destroy the Johnson Amendment and allow our representatives of faith to speak freely and without fear of retribution,” Mr. Trump promised in early February, just days after taking office.

White House officials said the president’s order will not eliminate the legal provision since doing so would require legislation from Congress. Instead, they said Mr. Trump would direct the I.R.S. not to actively investigate or pursue cases of political activism by members of the clergy.

Such a directive might be quickly challenged in court. But in the meantime, pastors could feel freer to participate in coming elections without fear of being investigated and having their tax-exempt status revoked by the federal government.

It could, in effect, instruct the I.R.S. to “carve as wide a berth as possible” and allow churches and other houses of worship to participate openly in campaigns for political candidates without any repercussions, said Richard W. Garnett, a law professor at Notre Dame and an expert on church/state issues.

Churches and clerics are free to speak out on political and social issues — and many do — but the Johnson Amendment served to inhibit them from endorsing or opposing political candidates.

Under the amendment, houses of worship and other nonprofit organizations that do endorse candidates are supposed to be investigated by the I.R.S. It is impossible to know how many churches have been targeted by the agency over the years because it does not make investigations public.

However, only one church is known to have ever lost its tax-exempt status for partisan politicking, and that was in 1995, said Rob Boston, director of communications at Americans United for Separation of Church and State. The Church at Pierce Creek in Conklin, N.Y., lost its tax-exempt status after warning Christians against voting for Bill Clinton for president in 1992.

Mr. Trump had dinner with a group of religious leaders in the Blue Room at the White House on Wednesday evening before the Rose Garden ceremony marking the annual prayer day on Thursday morning.

A coalition of evangelicals, Roman Catholics, Mormons and Orthodox Jews has been eagerly awaiting a religious liberty order that would give them broad latitude to operate their religious organizations without government requirements to avoid discriminating against gay and lesbian people, or to cover contraception in insurance plans.

Many of those religious leaders had hoped for more from Mr. Trump after a draft of a religious liberty executive order surfaced in early February. That order would have allowed churches, religious colleges and some privately held corporations to stop providing contraceptives as part of the insurance they offer to employees if doing so offended their religious beliefs.

The draft order could also have allowed adoption agencies that do not believe in placing children with same-sex couples to avoid doing so; hospice providers to refuse visitation to the same-sex spouse of someone in their care; and housing programs that receive federal funds to refuse to accept a gay, lesbian or bisexual teenager into the program.

Constitutional experts who read an early version of the executive order, which was leaked to The Nation magazine, were stunned that it was so sweeping.

Despite reports at the time that the religious liberty executive order was imminent, Mr. Trump did not announce it. But its existence had many conservative religious leaders and liberal civil liberties activists bracing for a similar directive this week.

Ryan T. Anderson, a senior research fellow at the Heritage Foundation who specializes in religious liberty, said Thursday afternoon that he had not seen a text of the executive order, but said he expected that “it will at least be a good first step.”

Gay rights groups and others held a march in front of the White House on Wednesday calling on Mr. Trump not to issue a broad executive order. And officials from the group held a conference call with reporters, vowing to challenge such an order in court.

They called the draft that circulated in February blatantly unconstitutional and an “unprecedented license to discriminate.”

“Freedom of religion does not give people the right to impose their beliefs on others, harm others, or to discriminate,” said Sarah Warbelow, the legal director at the Human Rights Campaign.

In a late-evening briefing for reporters, White House officials pointedly said the much more limited executive order that Mr. Trump will sign on Thursday does not address any issues of discrimination against gays, lesbians or anyone else.

Michael D. Shear reported from Washington, and Laurie Goodstein and Maggie Haberman from New York.

A version of this article appears in print on , on Page A15 of the New York edition with the headline: Trump Is Expected to Relax Tax Rules on Churches That Actively Take Part in Politics. Order Reprints | Today’s Paper | Subscribe