In the Yahoo interview on Thursday, which came on the heels of his calls to close some mosques and carefully monitor others, Mr. Trump suggested, with few specifics, that he would impose new measures to deal with terrorism.

Image Jeb Bush took a harsher tone, saying that Mr. Trump's idea was “just wrong.” Credit... Kevin Kolczynski/Reuters

“We’re going to have to do things that we never did before. And some people are going to be upset about it, but I think that now everybody is feeling that security is going to rule,” he said. “And certain things will be done that we never thought would happen in this country in terms of information and learning about the enemy. And so we’re going to have to do certain things that were frankly unthinkable a year ago.”

Asked by the Yahoo reporter about the possibility of a database for Muslims or “a form of special identification that noted their religion,” Mr. Trump did not reject either idea. Later that day, as Mr. Trump left a campaign event in Iowa, an NBC reporter followed up. Asked if he would set up a database to track Muslims, Mr. Trump replied, “I would certainly implement that. Absolutely.”

Asked about the effect that would have, however, he replied, “It would stop people from coming in illegally” — perhaps suggesting that Mr. Trump, who has vowed to build a “beautiful” wall along the Mexican border, was not focused on the question.

And when the NBC reporter approached Mr. Trump a second time and asked about the difference between registering Muslims and what happened to Jews in Nazi Germany, Mr. Trump grew impatient: “You tell me,” he said.

Mr. Trump’s remarks took hours to circulate widely over social media. But his seemingly serious consideration for the idea of treating an entire religious group with suspicion created the risk of a new set of problems for a Republican Party already struggling to appeal beyond its largely white political base. The party has also spent years objecting to what Republicans call government overreach by President Obama.