Republican presidential candidate Donald Trump said on Thursday that transgender people should be allowed to use whichever bathroom they prefer.

During a town hall on NBC, Trump said North Carolina's anti-LGBT bathroom measure, which has hurt the state economically, wasn't necessary and sought to address a problem that wasn't really a big issue. The bill also prohibits local municipalities from passing additional measures to protect lesbian, gay, bisexual and transgender people from discrimination.

"North Carolina did something that was very strong and they're paying a big price. There's a lot of problems," Trump said. "You leave it the way it is. There have been very few complaints the way it is. People go, they use the bathroom they feel is appropriate, there has been so little trouble, and the problem with what happened in North Carolina is the strife, and the economic punishment that they're taking."

Advocates of the North Carolina law, which only allows people to use the restroom that corresponds with the gender on their birth certificate, say it is necessary to protect the privacy of children. As Trump pointed out, the suggestion that allowing transgender people to use the bathroom they want will jeopardize the safety of other people is a myth.

Trump's position is a clear break from his rival for the Republican nomination, Sen. Ted Cruz (Texas), who has called the North Carolina bill a "perfectly reasonable determination for the people to make.”

“Men should not be going to the bathroom with little girls,” he said in an MSNBC town hall earlier this month.

Cruz repeated that position in response to Trump on Thursday and accused him of bending to political correctness.

"Donald Trump is no different from politically correct leftist elites. Today, he joined them in calling for grown men to be allowed to use little girls' public restrooms," Cruz said in a statement. "As the dad of young daughters, I dread what this will mean for our daughters - and for our sisters and our wives. It is a reckless policy that will endanger our loved ones."

Ohio Gov. John Kasich, who is also seeking the Republican nomination, has said he would not have signed the North Carolina law.

Trump added that he isn't sure if he had transgender people working for him in the Trump organization but "probably did." He also said he would feel comfortable letting Caitlyn Jenner, who came out as transgender last year, use whichever bathroom she felt comfortable choosing in Trump Tower.

﻿This story has been updated to include Cruz's statement.

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.