Jacquelyn Martin / AP

Updated at 7:29 p.m. ET on January 25, 2019.

On the 35th day of the longest government shutdown in U.S. history, Donald Trump gave in.

And for all the drama of the past month, the deadlock over whether to construct a wall along the southern border will end, for now, how it began: with the president accepting a deal he previously rejected, punting the question a few weeks down the road.

Trump on Friday afternoon said he would sign legislation to reopen the government for three weeks without the $5.7 billion in funding for a wall that he has demanded, unyielding, throughout the impasse. “In a short while, I will sign a bill to open our government for three weeks until February 15,” Trump said during remarks in the White House Rose Garden. “I will make sure that all employees receive their back pay very quickly or as soon as possible. It’ll happen fast.”

Trump asked Senate Majority Leader Mitch McConnell to put a bill ending the shutdown on the floor “immediately”—an unequivocal endorsement that Republicans had been seeking. Moments after Trump spoke, McConnell said on the Senate floor that he would do exactly that, paving the way for a rapid end to the shutdown. By 5 p.m. Eastern, the Senate had approved the legislation by voice vote, and the House followed suit later in the evening.

The agreement Trump endorsed represents an unmitigated defeat for the president, who repeatedly rejected calls from both Republicans and Democrats to postpone negotiations over a border-security package until after the government reopened. Indeed, it appears to be nearly identical to the deal Republicans endorsed—and Trump rejected—five weeks ago in an effort to head off a shutdown. After weeks of “spirited debate and dialogue,” Trump said, “I have seen and heard from enough Democrats and Republicans that they are willing to put partisanship aside, I think, and put the security of the American people first. I do believe they’re going to do that.”

Democrats celebrated the president’s decision while lamenting that it took so long for him to reach it. “It’s sad,” House Speaker Nancy Pelosi told reporters, “that it’s taken this long to come to an obvious conclusion.”

Senate Minority Leader Chuck Schumer said Democrats would now engage in a House-Senate conference committee to hash out broader legislation funding the Department of Homeland Security for the remainder of the year. “Hopefully it means a lesson has been learned,” he said, referring to Trump. “Shutting down government over a policy difference is self-defeating.” A Senate Democratic aide, speaking on the condition of anonymity in order to discuss internal conversations, said the deal emerged after Schumer rejected a bid from Trump to reopen the government “with a down payment on the wall.”

In typical fashion, the president did not concede defeat but held out hope that talks over the next several weeks would yield a bill that funds the wall. “Many disagree, but I really feel that working with Democrats and Republicans we can make a truly great and secure deal happen for everyone,” Trump said. “Walls should not be controversial.” At the end of his remarks, however, he warned that the government could shut down in February if he does not get his way. “If we don’t get a fair deal from Congress,” he said, “the government will either shut down on February 15 again or I will use the powers afforded to me under the laws and the Constitution of the United States to address this emergency.”

In the end, Trump’s hand was forced by angry and anxious Senate Republicans as well as by the cascading impact of the shutdown the president once said he’d proudly “own.” A crisis that Trump had tried to conjure on the southern border—vigorously disputed by congressional Democrats—had materialized instead in the nation’s airports, national parks, FBI and IRS offices, and the homes of well over 1 million federal employees and contractors who had gone without pay for more than a month.

Hundreds of thousands of federal workers have been working without getting paid. The financial burden caused callouts at the Transportation Security Administration to rise to levels two or three times above normal, straining the nation’s aviation system. It all seemed to come to a head on Friday morning, a day after the Senate rejected competing plans to reopen the government, including one that included money for Trump’s wall. A shortage of air-traffic controllers forced New York’s LaGuardia Airport to order a brief ground stop, while associated delays plagued airports elsewhere. On Thursday, the unions representing air-traffic controllers, pilots, and flight attendants warned that the shutdown was threatening the safety of the traveling public along with their members. “In our risk-averse industry, we cannot even calculate the level of risk currently at play, nor predict the point at which the entire system will break,” they said in a statement. “It is unprecedented.”

Meanwhile, public opinion turned decidedly against Trump and Republicans in Congress. Polls released over the past several days showed a consistent drop in the president’s approval rating, with respondents blaming him for the shutdown instead of Democrats by a wide margin. As the shutdown dragged on, labor groups representing federal employees made clear which party they held responsible. “Do we have your attention now, Leader McConnell? All lawmakers?” asked Sara Nelson, the president of the flight attendants’ union, in a statement responding to Friday’s airport disruptions. “Open the government and then get back to the business of democracy to discuss whatever issue you so choose. This shutdown must end immediately. Our country’s entire economy is on the line.”

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.