On Friday afternoon, just one day after he declared that he would never cave over his demand for a border wall, President Donald Trump walked into the Rose Garden and announced that he will sign a bill to reopen the government for three weeks, temporarily ending a monthlong shutdown that furloughed hundreds of thousands of federal workers, created a security nightmare at dozens of airports, and threatened to slow the U.S. economy. The deal, notably, does not include one cent for Trump’s wall, the signature issue on which he has bet his presidency. It is, in fact, almost identical to the deal Trump rejected at the end of December.

Lawmakers will now have until February 15 to negotiate some kind of compromise on border security, or the government will shut down again. Reading from a teleprompter outside the White House, Trump warned that if Democrats do not eventually acquiesce to his demands, he might use his executive authority to command the military to build the wall, instead. “We really have no choice but to build a powerful wall or steel barrier,” Trump said. “If we don’t get a fair deal from Congress, the government will either shut down on February 15, or I will use the powers afforded to me under the laws and Constitution of the United States to address this emergency.”

Trump did his best to frame the measure as a victory, saying he was “very proud to announce” a “deal to end the shutdown and reopen the federal government.” But there was no disguising the fact that he had been outplayed by House Speaker Nancy Pelosi, and badly misread the national mood. Earlier in the day, an ABC News/Washington Post poll showed Trump’s approval rating had fallen to a historic low of 37 percent. According to the survey, a whopping 53 percent of Americans blamed Trump for the shutdown, and 60 percent disapproved of how he was handling negotiations to reopen it. A higher percentage of Americans said they trusted Democrats to handle issues of border security (42 percent) and illegal immigration (47 percent) over the G.O.P.—a significant shift in sentiment over the past several months.

Trump’s capitulation was preordained the moment he decided to go to war with an incoming Democratic majority in the House, which aligned in solidarity behind Pelosi’s leadership and refused to back down. Early in the battle, Trump made an obvious strategic miscalculation when he boasted that he would take responsibility for a shutdown, a video clip that newsrooms played on repeat for weeks. Even after Trump attempted to shift blame to Democrats, the narrative was fully baked and the president had owned the shutdown, and all the subsequent headlines: federal employees holding demonstrations and lining up at food banks; unpaid air-traffic controllers walking off the job; Trump’s own economic adviser warning of economic stagnation, and F.B.I. director Christopher Wray furiously dressing down the president in a videotaped message to his employees. (Worst of all for Republicans, chaos at airports threatened the travel plans of hundreds of thousands of people traveling to and from the Super Bowl.)

A breaking point seemed to come when Pelosi effectively suspended Trump’s State of the Union address until the government was reopened, depriving him of a major media platform to promote his anti-immigration agenda. Trump responded by goading Pelosi to officially rescind the invite, but Pelosi called his bluff, immediately issuing a statement saying the speech was off. Shortly afterward, the president agreed that the State of the Union would have to be postponed.

“Trump looks pathetic,” a former White House official texted Axios’s Jonathan Swan, minutes after the president’s Rose Garden speech. “[He] just ceded his presidency to Nancy Pelosi.”

More Great Stories from Vanity Fair

— The family drama surrounding Joe Biden’s presidential bid

— What to make of the BuzzFeed-Mueller mystery

— A happy ending for one Fyre Festival contractor

— Intrigue in Murdoch-land

— Yes, Schitt’s Creek really is that good

Looking for more? Sign up for our daily Hive newsletter and never miss a story.