President Donald Trump and congressional leaders have reached a deal to reopen the government for three weeks and end the longest U.S. funding lapse ever, Trump announced Friday. In remarks at the White House, Trump said he hopes to sign the measure as soon as Friday, the 35th day of the partial shutdown. It would restart government operations through Feb. 15 — without the money he has demanded to build his proposed border wall. Both chambers of Congress passed the legislation Friday, sending it to Trump for expected approval. Both major parties will set up a conference committee to put together a Homeland Security appropriations bill once the government reopens. However, Trump threatened to let the government shut down again — or declare a national emergency to bypass Congress — if lawmakers do not reach a border security deal he likes. "We really have no choice but to build a powerful wall or steel barrier," the president said in the White House Rose Garden. "If we don't get a fair deal from Congress, the government will either shut down on Feb. 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."

Donald Trump Kevin Lamarque | Reuters

The deal will likely end an episode — for now — that has affected millions of American lives, sapped economic growth and cut into Trump's popularity. The agreement comes as the shutdown left hundreds of thousands of workers scrambling to cover meals and bills and caused disruptions in various government services. The pain from the closure sharpened Friday. About 800,000 federal workers started to miss their second paychecks since funding lapsed on Dec. 22. A shortage of air traffic controllers — who have had to work without pay during the shutdown — delayed flights at several major airports. Trump called the unpaid workers "fantastic people" and "incredible patriots." He pledged to make sure they get back pay "very quickly or as soon as possible." The employees could get their pay in four or five days, an administration official told CNBC. Speaking after Trump, Senate Minority Leader Chuck Schumer said shutdowns over policy are "self-defeating," adding, "We can never hold American workers hostage again." He contended that the Trump administration treated workers as "hostages" and "belittled their financial strain." Of course, the deal only temporarily delays another shutdown — or a potential constitutional fight over the president's power to declare a national emergency. Lawmakers may still fail to reach an immigration deal that satisfies Trump. In his remarks, he claimed no border security plan will work "without a physical barrier" — which Democrats have opposed despite saying they support other border security funding. He dedicated most of his speech to highlighting the dangers of illegal immigration. "This is an opportunity for all parties to work together for the benefit of our whole, beautiful, wonderful nation," he said.

Senate Majority Leader Mitch McConnell said he hoped Democrats would "stay true" to their commitment 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." Speaking after McConnell, Senate Minority Leader Chuck Schumer showed optimism about reaching a deal. "We don't agree on some of the specifics of border security. Democrats are against the wall. But we agree on many things ... and that bodes well for coming to an eventual agreement," he said. The deal to end the shutdown came after senators from both parties pushed Trump to temporarily fund the government while they try to strike a wider immigration deal. After two bills to reopen the government failed in the Senate on Thursday, serious talks to find an end to the impasse restarted for the first time in weeks. Trump asked for a "down payment" for the barrier in exchange for funding the government. Trump had repeatedly insisted on securing $5.7 billion to build his proposed border wall before he agrees to reopen the government. Democrats refused his request. The president has threatened to declare a national emergency to construct the wall without congressional approval. On Friday, Trump said he has a "very powerful alternative, but I didn't want us to use it at this time. Hopefully it will be unnecessary." The Trump-backed plan that failed in the Senate would have funded the wall in exchange for limited legal protections for young immigrants brought to the U.S. illegally as children and people fleeing crises in certain countries. Democrats called the concessions for "Dreamers" inadequate. It is not clear whether lawmakers would try to address those issues if they reopen the government. Surveys indicate most Americans see the closure as a "crisis" or at least a "problem." They largely put blame for the shutdown on Trump's shoulders. As Americans sought an end to the impasse, more of them believed the president should yield rather than thought congressional Democrats should, according to a CBS News poll.