President Donald Trump on Friday night signed a bill to fund and reopen portions of the US government that had been shuttered for 35 days. Trump announced his support for the plan earlier Friday, which will temporarily end the shutdown.

The plan funds affected agencies for three weeks, until February 15.

Congress quickly passed the measure.

The longest US government shutdown in history has ended — for now.

President Donald Trump signed a bill passed by Congress on Friday night that temporarily funds and reopens government agencies until February 15. Trump announced his support for the bill earlier Friday in a speech at the White House.

Trump's support cleared the way for congressional leaders to quickly pass a short-term funding bill called a continuing resolution, setting up a high-stakes negotiating period to avoid another closure before a February 15 deadline.

The deal does not include any money for Trump's proposed wall along the US-Mexico border and would give federal workers back pay. The idea is similar to the continuing resolution advanced in the Senate before the shutdown started on December 22. Democrats have demanded that Trump first open the government and then negotiate about a wall.

Read more: Congress finally met its breaking point on the government shutdown after airport delays took a punishing toll»

In his speech, Trump advocated a border wall and threatened to shut down the government again if Democrats do not agree to give him money for it.

"We really have no choice but to build a powerful wall or steel barrier," the president said. "If we don't get a fair deal from Congress, 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."

Trump also alluded to his previous threats to bypass Congress and declare a national emergency to get money for the wall.

"As everyone knows, I have a very powerful alternative, but I didn't want to use it at this time," Trump said.

Friday is the 35th day of the shutdown, and the negative effects of the closure have taken a toll. Federal workers missed their second consecutive paycheck, and staffing issues led to widespread delays at major airports across the US — a major factor in Trump's willingness to support a short-term continuing resolution, CNN reported.

Prior to the passage of the bill, the Office of Management and Budget instructed agencies "to prepare for an orderly reopening."

"As agencies identify these steps, they should be prepared to prioritize restoring pay and benefits for employees, ensuring appropriate physical and information technology systems security access, recalling employees from furlough status, and performing any other critical support function needed to carry out these activities," the memo form OMB's Deputy Director for Management, Margaret M. Weichert said.

As far as timing, a senior administration official told INSIDER "the urgency of getting Federal employees paid quickly" is clear, and said "the administration is taking steps to ensure that they receive pay as soon as possible."

"Since specific payroll issues vary by agency, employees can find more information about paycheck details by reaching out to their agency."

Read more: Hundreds of flights delayed in New York and Atlanta as the longest government shutdown in history leads to air-traffic-control staffing shortages

Reopening the government will allow for federal workers to get back pay, which would provide much-needed financial relief for those facing mounting bills.

The president expressed gratitude for the 800,000 federal workers who have gone over a month without pay.

"I want to thank all of the incredible federal workers and their amazing families who have shown such extraordinary devotion in the face of this recent hardship," Trump said. "You are fantastic people. You are incredible patriots."

The shutdown started on December 22 when Trump rejected a short-term funding extension because it did not include money for his long-promised border wall. Since then, Trump and Democratic leaders have been in a standoff over his request for $5.7 billion to fund a wall.

Democrats have repeatedly requested that the president support a short-term funding bill with no wall money, and party leaders have said that no negotiations about a wall will take place while the government is closed.

Negotiations to end the shutdown seemed stalled in recent days. On Thursday, the Senate shot down two bills that would have reopened the government — one with funding for a border wall, and one without. The bill with the wall funding was modeled on a plan announced by Trump on Saturday that would have traded his requested wall money for temporary extensions to protections for so-called Dreamers, undocumented immigrants who were brought to the US as children.

Read more: Democrats rejected Trump's immigration deal for 3 glaring reasons

After the failure of the two bills, Senate Majority Leader Mitch McConnell and Minority Leader Chuck Schumer met to work out a path forward, which appears to have yielded some success.

Trump has consistently resisted opening the government with a short-term bill that does not include wall funding, but recent polling has found that nearly half of Americans blame Trump for the shutdown and that most dislike the president using the shutdown as a political tool.