Updated at 9:45 p.m. ET
The longest government shutdown in history ended after President Trump signed a bipartisan three-week stopgap funding measure late Friday. Several agencies had been partially shuttered for 35 days.
"I am very proud to announce today that we have reached a deal to end the shutdown and reopen the federal government," Trump said earlier Friday in the White House Rose Garden, announcing the long-awaited bipartisan breakthrough.
By Friday evening, the House and Senate had unanimously passed the bill to fund the government through Feb. 15. Lawmakers also authorized moving forward on a longer-term Department of Homeland Security funding bill for the rest of the fiscal year, where border security funds can be negotiated on a bipartisan basis.
The question remains, however, what exactly Trump accomplished with his firm stance against any deal without funding for a border wall, which he eventually capitulated to.
The stopgap measure does not include funding for the wall along the U.S.-Mexico border that Trump has pushed for. The Homeland Security bill does not include money earmarked for a wall, either, but a bipartisan group of lawmakers will hammer out the details over the next few weeks.
Ultimately, as the president's approval ratings tumbled and polls showed the public largely blamed Republicans for the increasingly dire situation — punctuated on Friday by massive delays at major airports and recent warnings about a threat to national security — Trump finally seemed to back down from his demands. At least for now.
Another shutdown looming in three weeks?
Trump seemed to revive earlier deal-breakers as he ended his speech, warning that if negotiations over the next three weeks don't result in funding for the "powerful wall or steel barrier" he has demanded, "the government would either shut down again" or he would declare a national emergency to build the wall.
"I have a very powerful alternative, but I didn't want to use it at this time. Hopefully it will be unnecessary," Trump teased at the beginning of his remarks about the extreme measures — which would very likely face legal challenges in court.
"We do not need 2,000 miles of concrete wall from sea to shiny sea," the president added, showing an openness to some technology efforts that some Democrats have signaled they could back. Still, he reiterated proposals to build barriers in specific areas identified by the Border Patrol, strengthen security at legal ports of entry and provide humanitarian assistance to those who have crossed the border.
"Walls or barriers or whatever you want to call it will be an important part of the solution," said Trump, who has regularly contradicted himself on how he describes the promised wall.
Trump insisted later Friday evening on Twitter that the deal "was in no way a concession."
Democrats take a victory lap
Trump and Republicans had long maintained any deal to end the shutdown must include funding for the border wall the president wants, which was his key promise during the 2016 campaign. But Democrats said they should reopen the government and then resume talks, which is exactly what Friday's deal does.
Democratic leaders argued their conference's unity is what eventually caused Trump to cave.
"The American people do not like it when you throw a wrench into the lives of government workers over an unrelated political dispute," Senate Minority Leader Chuck Schumer, D-N.Y., told reporters. "Hopefully now the president has learned his lesson."
The first signs of a crack in Trump's resolve came earlier this week. After House Speaker Nancy Pelosi, D-Calif., said he could not give the State of the Union address until after the shutdown, Trump threatened to hold the annual speech someplace else. But he backed down hours later and said he would defer to Pelosi.
It's unclear when the State of the Union, which had been slated for next Tuesday, will happen following Friday's deal to end the shutdown. Pelosi told reporters that it is "not planned now" and that she had told Trump "when the government is opened we will discuss a mutually agreeable date."
Pelosi, a veteran appropriator, said she was hopeful the three-week talks would produce a deal on border security, though she didn't answer a question about whether that may include any funding for even portions of a wall. She has repeatedly said she is opposed to a wall and has called it "immoral."
"I see every challenge or every crisis as an opportunity," Pelosi said.
Speaking on the Senate floor shortly after Trump endorsed the deal, McConnell said he too was optimistic, but with some caveats.
"Going forward, I hope Democrats will stay true to the commitment they have stated constantly over the past weeks — that once government was reopened, they would be perfectly willing to negotiate in good faith on full-year government funding that would include a significant investment in urgently needed border security measures, including physical barriers," McConnell said.
Consequences of the prolonged shutdown
Federal employees who have been working without pay or are furloughed would also get back pay as part of the agreement, though it's unclear how long that might take.
The American Federation of Government Employees says workers could get back pay as soon as next Thursday, but the union says it is also possible they won't get paid until their next scheduled pay date during the week of Feb. 4.
A senior administration official says "the administration is taking steps to ensure that they receive pay as soon as possible."
Federal contractors also impacted by the shutdown would not get any back pay.
The breakthrough comes as federal workers missed their second paycheck in a row, now going without their salaries for more than a month. Trump thanked those workers, calling them "patriots" and said they have "suffered" far greater than anyone but they and their families can understand.
The prolonged stalemate pushed the nation's security and infrastructure to the brink, with significant flight delays at major airports due to Federal Aviation Administration and Transportation Security Administration absences escalating on Friday. The FBI also warned that critical crime-fighting measures have been curtailed with its agents limited and working without pay.
How it began
The shutdown began on Dec. 22, when Republicans still had control of a lame-duck Congress following their loss of 40 seats in the House in November 2018.
After two years of unified control, the GOP president was unable to push through Trump's signature campaign promise — which he repeatedly said during the 2016 campaign that Mexico would pay for — and there seemed to be an urgency to his last push. Egged on by conservative media and pundits, Trump drew a line — until he didn't.
Schumer said the lesson Trump should take away from the quagmire is that Pelosi, who reclaimed the speaker's gavel at the beginning of January, should not be taken lightly.
"No one should ever underestimate the speaker, as Donald Trump has learned," Schumer said.
NPR congressional correspondents Susan Davis and Kelsey Snell and NPR national security correspondent Greg Myre contributed to this report.