PANAMA CITY, Fla.  Faced with withering Republican criticism of his defense of the right of Muslims to build a community center and mosque near ground zero, President Obama quickly recalibrated his remarks on Saturday, a sign that he has waded into even more treacherous political waters than the White House had at first realized.

In brief comments during a family trip to the Gulf of Mexico, Mr. Obama said he was not endorsing the New York project, but simply trying to uphold the broader principle that government should “treat everybody equally,” regardless of religion.

“I was not commenting, and I will not comment, on the wisdom of making the decision to put a mosque there,” Mr. Obama said. “I was commenting very specifically on the right people have that dates back to our founding. That’s what our country is about.”

But Mr. Obama’s attempt to clarify his remarks, less than 24 hours after his initial comments at a White House iftar, a Ramadan sunset dinner, pushed the president even deeper into the thorny debate about Islam, national identity and what it means to be an American  a move that is riskier for him than for his predecessors.