Trump's allies had fanned out in discontent, venting on television and social media, and urging the president to veto the funding bill unless it contains more money for the wall.
"If we're not going to fight now, when are we going to fight?" Rep. Mark Meadows, R-N.C., asked Thursday on "Fox and Friends."
Conservative commentator Ann Coulter published a column that called Trump "gutless" and said in a radio interview that she won't vote for Trump in 2020 if he doesn't deliver on the wall.
"Nor will, I think, most of his supporters. Why would you?" she asked, arguing that Trump's time in office will one day go down as "a joke presidency that scammed the American people."
Conservative talk radio host Rush Limbaugh said Trump had "gotten word" to him that he would either be "getting funding to the border or he's shutting the whole thing down." That was after Limbaugh complained a day earlier that it appeared "Trump gets nothing and the Democrats get everything, including control of the House."
With the clock ticking before a partial shutdown starts at midnight Friday, Republicans scrambled for a solution. But progress was far from certain as Trump's allies urged him to veto any deal that did not include the wall money he's demanded. They warned that Trump would have even less leverage after Democrats take control of the House on Jan. 3 and worried that Trump's failure to make good on his signature campaign promise could hamper his re-election campaign.
Aware that his supporters wanted to see a fight, Trump — shaken by the criticism and lashing out at aides — decided to give them one. He issued threatening tweets and a stern statement from his press secretary and then called GOP lawmakers to the White House, where he told them he wasn't on board with the Senate-approved temporary measure, which keeps government open until Feb. 8 and does not include wall funding.
It was a tense meeting, with Trump criticizing House Speaker Paul Ryan for giving him what he described, using expletives, as a terrible deal that could cost him the support of his base, according to a person familiar with the exchange who spoke on condition of anonymity to discuss a private conversation.
"I am asking Congress to defend the border of our nation," Trump said at a White House event. "Walls work, whether we like it or not."
Ratcheting up the suspense, Trump added: "I look forward to signing a bill that fulfills our fundamental duty to the American people ... we'll see what we can do."
Despite his line in the sand, Trump appeared to float one possible path to compromise, referring to "steel slats" at the border rather than the concrete barrier he'd talked about during the campaign. With that phrasing, Trump appeared to be describing fencing, to which Congress is more amenable.
Trump has repeatedly been foiled in his efforts to secure funding for his border wall, which was a rallying cry during his 2016 presidential campaign. This time it was thought he had little choice but to fold, even after he declared he would be "proud" to shut the government for his wall. Even in the GOP-controlled House, Trump did not have the votes to get $5 billion in wall money.
The White House had previously floated another possible work-around, suggesting Trump would approve a deal with no wall dollars and pursue other funding options. Trump said he would use the military to fund and build the wall, while White House press secretary Sarah Huckabee Sanders said Trump had directed all his Cabinet secretaries to look for usable funds.
The last-minute mayhem echoed the previous budget showdown. In March, Trump grudgingly signed a $1.3 trillion federal spending measure to avert a shutdown, but only after undercutting his own staff with a last-minute veto threat. At the time, Trump angrily said he was "very disappointed" that the package did not fully pay for his planned border wall, but said the measure would fund the military.
Trump is hardly the first president to be confronted with the challenges of passing a legislative priority through Congress. But the lack of progress on an issue so closely identified with his bid for the White House may prove to be a costly failure.
He had promised to begin working on an "impenetrable physical wall" along the southern border on his first day in office, but little headway has been made. A March bill included money for 33 miles (53 kilometers) of barrier construction in South Texas' Rio Grande Valley, but work there has yet to begin. Other work has merely replaced existing barriers that had been deemed "ineffective," not added miles.
Associated Press writers Lisa Mascaro, Zeke Miller and Jonathan Lemire contributed to this report.
Follow Miller and Colvin on twitter at https://twitter.com/ZekeJMiller and https://twitter.com/colvinj