Donald Trump says he now supports North Carolina’s anti-LGBT law, despite having criticized the legislation months ago.

HB 2, which North Carolina Gov. Pat McCrory (R) signed into law earlier this year, bars transgender people from using public bathrooms designated for the gender with which they identify and bans municipalities from passing their own LGBT anti-discrimination policies. The law has been widely criticized, including by many CEOs of prominent corporations who have said it will hurt the state’s economy.

Trump initially joined in the anti-HB 2 rhetoric, pointing out the law’s potential to hurt businesses in North Carolina and arguing that people should have the right to use whichever bathroom “they feel is appropriate.” He walked back that position in May, arguing that states have the right to enact such legislation.

But now that he is his party’s presumptive presidential nominee, Trump seems to have fully changed his tune: He’s “going with the state,” he told The News & Observer on Tuesday.

“The state, they know what’s going on, they see what’s happening and generally speaking I’m with the state on things like this,” he said. “I’ve spoken with your governor, I’ve spoken with a lot of people and I’m going with the state.”

McCrory has offered lukewarm support for Trump, and missed the candidate’s Tuesday rally in Raleigh.

Trump’s reversal came weeks after he claimed he would be a better president for LGBT Americans than presumptive Democratic nominee Hillary Clinton, who is a vocal opponent of HB2.

“Hillary Clinton can never claim to be a friend of the gay community as long as she continues to support immigration policies that bring Islamic extremists to our country who suppress women, gays and anyone who doesn’t share their views,” Trump said last month after a gunman killed 49 people at a gay nightclub in Orlando, Florida.

He repeated the claim days later, calling on people to “ask the gays” who is their “friend.” The question was immediately mocked on Twitter.

Trump’s latest comments on HB2 drew criticism from major LGBT equality groups.

“Let’s be clear, Donald Trump just gave one of the nation’s worst laws for LGBTQ people a full-throated endorsement,” said JoDee Winterhof, senior vice president for policy and political affairs at the Human Rights Campaign.

“By buddying up with Governor Pat McCrory on the deeply discriminatory HB2, Donald Trump is unabashedly embracing a dangerous law that takes away the civil rights of LGBTQ people and has cost North Carolina not only its reputation but millions of dollars in economic losses,” Winterhof continued.

“Donald Trump’s garbled comments on HB2, the worst anti-LGBT law in the nation, show that he does not grasp the issues critical to the state of North Carolina,” Chris Sgro, the executive director of Equality NC, said in a statement. “Over and over, he has shown himself to be unqualified as a Presidential candidate, and no friend to gay and transgender people. We must resoundly reject his ill-informed discrimination in November.”

Editor’s note: Donald Trump regularly incites political violence and is a serial liar, rampant xenophobe, racist, misogynist and birther who has repeatedly pledged to ban all Muslims ― 1.6 billion members of an entire religion ― from entering the U.S.