Vermont Senator Bernie Sanders on Thursday criticized a new rule that allows taxpayer-funded faith-based adoption agencies to refuse placement with LGBT couples.

The Department of Health and Human Services (HHS) rule undoes an Obama-era policy that went into effect in December 2016. While the new rule has yet to take effect, HHS has said that it will no longer enforce the current rule.

(Related: New Trump admin rule allows adoption agencies to refuse placement with LGBT couples.)

Sanders, a leading candidate for the 2020 Democratic presidential nomination, made his remarks at the annual 2019 International LGBTQ Leaders Conference, the Washington Blade reported.

“We have seen mean-spirited and dangerous attempts to demonize LGBTQ people under the pretense of ‘religious liberty,'” Sanders said. “And we have sadly and unexpectedly seen the Trump administration recently propose a new rule that would provide federal grants to religious organizations that actively discriminate against LGBTQ individuals, preventing them from adopting or caring for children in foster care, preventing them from enrolling their kids in pre-K programs and preventing them from receiving the health care services that they need.”

“On a personal note, not as a candidate, just as an American citizen – somebody who opposes Trump on everything, that goes without saying – but maybe the ugliest thing that he is doing, which is kind of unprecedented, is to really go out of his way for cheap political gain to try to divide the American people up based on the color of our skin, where we born, our sexual orientation, our religion, our gender,” Sanders said.

Sanders also criticized the Trump administration for arguing before the Supreme Court that employers should be allowed to fire employees based on their sexual orientation or gender identity and reinstating a ban on transgender troops.

The presidential candidate also touted his record on LGBT rights.

“In Congress, I have consistently fought against efforts to ban marriage equality, and I'm proud to be the only candidate for president to have voted against the Defense of Marriage Act in 1996,” Sanders said to applause from the crowd.