WASHINGTON — President Trump agreed Friday to reopen the federal government for three weeks while negotiations proceeded over how to secure the nation’s southwestern border, backing down after a monthlong standoff failed to force Democrats to give him billions of dollars for his long-promised wall.
The decision paved the way for Congress to pass spending bills as soon as Friday that Mr. Trump will sign to restore normal operations at a series of federal agencies until Feb. 15 and begin paying again the 800,000 federal workers who have been furloughed or forced to work for free for 35 days.
The plan includes none of the money for the wall that he had demanded and was essentially the same approach that Mr. Trump rejected at the end of December, meaning he won nothing concrete during the impasse. But if Republicans and Democrats cannot reach agreement on wall money by the February deadline, he indicated that he was ready to renew the confrontation or declare a national emergency and bypass Congress altogether.
“We really have no choice but to build a powerful wall or steel barrier,” Mr. Trump said in the Rose Garden. “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.”
The cease-fire could pave the way for Mr. Trump to deliver his State of the Union address to Congress after all, but Speaker Nancy Pelosi quickly clarified that it would not be held next Tuesday as originally scheduled. She had rescinded her invitation earlier this week to come to the House chamber until the government was reopened, and on Friday, the speaker said she would work with Mr. Trump to find a new date.
“The State of the Union is not planned now,” Ms. Pelosi said. “When government is open we will discuss a mutually agreeable date.”
As he announced the move, Mr. Trump paid tribute to the federal workers who have endured five weeks without pay, expressing sympathy for them in a way he had not until now. “You are fantastic people,” he said. “You are incredible patriots. Many of you have suffered far greater than anyone that your families would know or understand.”
He promised to ensure that workers will be compensated for the paychecks they have missed since the shutdown began in late December. “I will make sure that all employees receive their back pay very quickly or as soon as possible,” he said. “It will happen fast.”
The surprise announcement was a remarkable surrender for a president who made the wall his nonnegotiable condition for reopening the government. Mr. Trump relented as the effects of the shutdown rippled across the Northeast, with effects far beyond paychecks, such as air traffic slowing Friday because of a shortage of air traffic controllers, who called in sick. The F.B.I. director said he was as angry as he had ever been over his agents not being paid, and workers at the Internal Revenue Service called in sick.
Mr. Trump offered no explanation for his surrender, nor did he even acknowledge that it was one. Still, by midday Friday, the mounting costs were weighing on the president.
Cabinet officials and White House aides lined the sides of the Rose Garden and applauded him. The president began his remarks as if he had actually emerged victorious, saying that he was “very proud to announce” what he called “a deal to end the shutdown and reopen the federal government.”
With polls showing the president enduring most of the blame by the public, Republicans led by Senator Mitch McConnell of Kentucky, the majority leader, pressured Mr. Trump to agree to the temporary cease-fire. Over the next three weeks, a House-Senate conference committee representing both parties will negotiate a border security plan, but if it fails to reach a consensus, government agencies could close again.
The president’s concession came a day after two competing measures to reopen the government failed on the Senate floor. A Democratic bill, which would have reopened the government with no strings attached, received more votes than the bill backed by Mr. Trump, which included temporary protections for some undocumented immigrants in exchange for $5.7 billion for his proposed border wall.
Mr. McConnell spent part of Friday morning talking to Mr. Trump about what kind of border security the president would accept — other than a wall — in exchange for a promise from Democrats that they would at least debate the wall in the Senate during the regular course of business, according to a senior Republican aide familiar with the talks.
This person said that Mr. McConnell’s goal was to pressure moderate Democrats, who had expressed openness to a physical barrier, to agree to one. If they did not, the person said, Republicans or Mr. Trump could shut down the government again — with much of the pressure caused by 800,000 federal workers who had gone without pay somewhat alleviated.
On the Senate floor on Thursday, a bipartisan group of senators signed on to an amendment that would open the government for three weeks without conditions and with a commitment in good faith to negotiate a broader border security solution in that time.
“What we have put on the table is our reputation as legislators, that given three weeks, we’ll come up with a successful conclusion on the border security issue,” said Senator Benjamin L. Cardin, Democrat of Maryland.
Republican leaders tried to rally their members during a closed policy luncheon before Thursday’s votes. But even as Republicans prepared to support Mr. Trump’s plan, the signs of mounting frustration after weeks of inaction were evident.
Republican senators rose one by one to voice concerns about the impact on federal workers and Mr. McConnell’s decision to limit votes to reopen the government.
At one point, Senator Ron Johnson, Republican of Wisconsin, vented at Mr. McConnell for putting Republicans in the position of having to vote on two competing approaches to reopen the government — one Republican and one Democratic — without consulting Senate Republicans first.
“You put us in this position,” Mr. Johnson said, according to one of his aides. Another senior Republican aide familiar with the exchange said Mr. Johnson told Mr. McConnell that it was “your fault.”
Mr. McConnell, who had largely absented himself from negotiations to reopen the government until late last week, responded, “Are you suggesting I’m enjoying this?”
Mr. McConnell also signaled to Vice President Mike Pence, who attended the lunch, that Senate Republicans were generally not supportive of shutdowns.
“There is no education in the second kick of a mule,” he said, repeating a line he has used frequently, according to two people familiar with the exchange.
Details of the exchange were first reported by The Washington Post.