WASHINGTON — President Trump has stepped back from declaring a national emergency to pay for a border wall, under pressure from congressional Republicans, his own lawyers and advisers, who say using it as a way out of the government shutdown does not justify the precedent it would set and the legal questions it could raise.

“If today the national emergency is border security, tomorrow the national emergency might be climate change,” Senator Marco Rubio of Florida, one of the idea’s critics, said this week. Another Republican, Senator Mitt Romney of Utah, told an interviewer that declaring a national emergency should be reserved for “the most extreme circumstances.”

Mr. Trump, who according to aides has grown increasingly frustrated over the refusal of Democrats to bend and sees the shutdown as a road with no off-ramp in sight, hinted on Friday that the warnings were having an effect.

“What we’re not looking to do right now is national emergency,” he told reporters gathered in the Cabinet Room as the shutdown approached its fourth week. Minutes later he contradicted himself, saying that he would declare a state of emergency if he had to.