Declaring that religious freedom is 'under threat,' President Donald Trump vowed Thursday to repeal a rarely enforced IRS rule that says clergy who endorse candidates from the pulpit risk losing their tax-exempt status.

'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,' Trump said at the National Prayer Breakfast, a high-profile event bringing together faith leaders, politicians and dignitaries.

Trump's pledge was a nod to his evangelical Christian supporters, who helped power his White House win.

So far he has not detailed his plans for doing away with the rule, which he has previously promised to rescind.

Named after then-Sen. Lyndon Johnson, the regulation has been in place since 1954 for tax-exempt charities, including churches, though it is very rare for a church to actually be penalized.

Vow: '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,' Trump said during the National Prayer Breakfast

Thumbs up back: Trump's pledge was a nod to his evangelical Christian supporters, who helped power his White House win

Abolishing the amendment would require action by Congress, though Trump could direct the IRS to disregard the rule.

The tax code does allow a wide range of political activity by houses of worship, including speaking out on social issues and organizing congregants to vote.

But churches cannot endorse a candidate or engage in partisan advocacy.

Lloyd Mayer, a law professor at the University of Notre Dame, said an IRS move could prompt lawsuits, if the rule was repealed for churches but not other charities.

Mayer also noted that a full repeal of the rule could open up churches to the possibility of spending their resources to openly try to influence elections - and for donors to get tax breaks for political contributions.

While some conservative Christians would like to see the rule abolished, others, especially the younger generation, support a clear separation of church and political endorsements.

Many liberal churches are also active on policy issues, and could potentially get more involved in partisan politics.

Mayer noted that for some religious leaders, the IRS rule has given them a way to avoid political pressure for an endorsement.

'Now a church that wants to say no has an easy answer, it's illegal,' Mayer said.

Repeal does not appear to have widespread public support. Eight in 10 Americans said it was inappropriate for pastors to endorse a candidate in church in a poll released last September by Lifeway Research, a religious survey firm based in Nashville.

For many religious conservatives, a more pressing issue they hope he will address is protection for faith-based charities, schools and ministries who object to same-sex marriage and abortion.

The president made no mention at the prayer breakfast of other steps he may take, saying only that religious freedom is a 'sacred right.'

Kelly Shackelford, head of First Liberty Institute, a non-profit legal group that specializes in religious freedom cases said that 'there's a number of things he laid out that we expect we'll eventually see action on.'

Trump also defended his recent executive order on immigration, decrying 'generous' immigration policies and arguing that there are people who seek to enter the country 'for the purpose of spreading violence or oppressing other people based upon their faith.' He also pledged to take more immigration action in the name of religious liberty.

Popular choice: Evangelicals have so far been behind Neil Gorsuch, Trump's choice for the Supreme Court seat left vacant by the sudden death of Justice Scalia

'In the coming days we will develop a system to help ensure that those admitted into our country fully embrace our values of religious and personal liberty and that they reject any form of oppression and discrimination,' Trump said.

LGBTQ groups have been anxious that the president could use his executive powers to curb legal advances they have made.

Emily Hecht-McGowan, chief policy officer for the Family Equality Council, said that she was 'anticipating more to come,' noting that some draft documents have been circulating, suggesting plans for a more sweeping order.

White House spokesman Sean Spicer said Thursday that 'there's nothing new on that front.'

Earlier this week, the Trump administration announced that the president would leave intact a 2014 executive order that protects workers for federal contractors from anti-LGBTQ discrimination, saying in a statement that Trump 'continues to be respectful and supportive of LGBTQ rights, just as he was throughout the election.'

Religious conservatives, who saw a series of defeats on same-sex marriage, abortion and other issues under former President Barack Obama, have been bolstered by Trump's win. In a letter last year to Roman Catholics, Trump pledged, 'I will defend your religious liberties and the right to fully and freely practice your religion, as individuals, business owners and academic institutions.'

Trump's Supreme Court pick this week was also considered a positive sign for conservatives.