Donald J. Trump said Thursday that transgender people should be allowed to use whatever bathroom they feel most comfortable with — including at Trump Tower in New York. Dipping into a contentious issue by taking a stand many Republicans oppose, Mr. Trump told a town-hall-style event, hosted by NBC’s “Today” show at Rockefeller Center in Manhattan, that when people go to the restroom, they should “use the bathroom they feel is appropriate.”

Mr. Trump, the Republican presidential front-runner, was responding to a question about a bill that North Carolina’s governor signed into law last month that bars individuals in the state from using public bathrooms that don’t correspond to their biological sex — the one listed on their birth certificate. Since then, there has been a backlash from businesses and celebrities opposed to the state’s action. And transgender issues have pitted social conservatives against business interests that traditionally have been part of the Republican coalition in the South and elsewhere.

“North Carolina did something — it was very strong — and they’re paying a big price,” Mr. Trump said. “And there’s a lot of problems. And I heard — one of the best answers I heard was from a commentator yesterday saying, leave it the way it is, right now.”

He added that before the law passed, there had been “very few problems” but now North Carolina is experiencing an exodus of businesses and “strife” from people on both sides of the issue. North Carolina’s law, which also removed anti-discrimination protections for L.G.B.T. people, and the backlash to it, is now at the heart of the state’s hotly contested governor’s race.

“You leave it the way it is,” he said. “There have been very few complaints the way it is.”

Asked if the Trump organization employs any transgender people, Mr. Trump said he truly didn’t know, but added, “I probably do.” And in response to a follow-up question, he said that if Caitlyn Jenner were to walk into Trump Tower and want to use a bathroom, he would be comfortable with her choosing any bathroom she wanted. “That is correct,” Mr. Trump said.

“You know, there’s a big move to create new bathrooms,” Mr. Trump said. “Problem with that is for transgender. That would be — first of all, I think that would be discriminatory in a certain way. It would be unbelievably expensive for businesses and for the country. Leave it the way it is.”

But Senator Ted Cruz of Texas quickly seized on his Republican rival’s remarks, saying on Twitter: “Common sense: grown men shouldn’t be in bathrooms w/ little girls.”