WASHINGTON – After 35 days, it's over — at least for now.

President Donald Trump on Friday signed a temporary deal to end to the longest government shutdown on record. Federal agencies will reopen for three weeks while lawmakers continue negotiations over Trump's request for funding for a wall along the southern border.

This shutdown was unlike any before it. Along with setting a grim record for its length, it led to an even deeper divide between Republicans and Democrats and gave House Speaker Nancy Pelosi her first test with going head-to-head with the president.

Here is a look back at some of the biggest moments of the partial government shutdown:

Dec. 11: The White House meeting

It was a fight for the ages and the public was invited to watch.

Trump told Democratic leaders in a remarkable on-camera clash he would be "proud" to shut down the federal government if he doesn’t get the $5.7 billion he demands for a border wall with Mexico.

“If we don’t get what we want ... we will shut down the government," Trump said during an exchange in the Oval Office with Pelosi and Schumer.

Pelosi and Schumer gave as good as they got, telling Trump he lacks support for border wall funding – even while Republicans still control the House – and is irresponsible in threatening to halt the government over a project that would be ineffective at best.

"You don't have the votes," Pelosi said.

Dec. 19: Senate passes bill to keep government open

A short-term spending bill that would fund the government through early this year cleared the Senate, a solution aimed at averting a government shutdown.

Senators voted by voice vote to approve the spending measure, which would temporarily end a budget impasse by funding nine federal departments and several smaller agencies at their current funding levels through Feb. 8.

The bill was sent to the House for approval.

Senate Majority Leader Mitch McConnell, R-Ky., offered the temporary spending bill after Trump’s demand for $5 billion in funding for a wall along the nation’s southern border resulted in a standoff that threatened to shut down parts of the government.

It wasn't clear whether Trump would sign the measure but the White House appeared to retreat from Trump's position of being "proud" to shutdown the government and take any blame for the impasse.

White House spokeswoman Sarah Sanders said one day earlier that Trump asked his Cabinet secretaries to look for other sources of funding to help protect the border and suggested that the administration is looking to Congress for ways to avoid a shutdown.

Dec. 20: Trump won't sign bill; House adds border funds

A deeply divided House voted to add $5 billion in border wall funding to a short-term spending bill, yielding to Trump’s demand for the money but casting further doubts that the government would shutdown.

The bill, which the House approved by a vote of 217-185, was sent back to the Senate for another vote.

The House vote capped a drama-filled day that started with lawmakers anticipating quick passage of an already approved Senate funding bill. The day broke into chaos after the president said he would not approve of the Senate's bill since it did not include border funds. The announcement led to House members adding $5.7 billion for a border wall but also meant the Senate would have to vote again on the spending bill.

“I’ve made my position very clear: Any measure that funds the government must include border security,” Trump said at the White House.

Dec. 22: The government shutdown begins

A flurry of negotiations in the Senate couldn't muster up enough votes to pass the House's spending bill, leading to the partial government starting at midnight.

Congressional leaders and the White House worked behind the scenes late Friday in hopes of striking a deal but Trump acknowledged that he was ready for "a long shutdown."

For much of yet another chaotic day on Capitol Hill, lawmakers scrambled to piece together a last-minute agreement that would keep government funds flowing past Friday’s midnight deadline.

At midafternoon, Vice President Mike Pence and two of Trump’s top lieutenants – Budget Director Mick Mulvaney and adviser Jared Kushner – traveled to the Capitol for a series of meetings to try to broker a deal.

An agreement proved elusive, but in what was hailed as a bit of a breakthrough, congressional leaders and the White House agreed to continue their talks after a procedural vote in the Senate. Yet even that incremental step required a tie-breaking vote by Pence.

Jan. 2: Dems meet with Trump at White House - again

Pelosi and Schumer left a meeting at the White House, telling reporters that both sides were no closer to resolving the dispute over border funds.

Schumer said that Trump was using the shutdown as "hostage" to get what he wants. Democrats tried to persuade Trump to reopen the government and continuing to negotiate over funds for border security.

"The only reason that they are shutting down the government is very simple," Schumer said after the meeting. "They want to try and leverage that shutdown into their proposals on border security."

Republicans agreed that no headway was made in negotiations to end the shutdown.

Jan. 3: New Congress, new bills

New members of Congress were officially sworn in, giving Democrats control of the House.

Later that evening, the House passed two measures that would reopen the government and postpone bickering over border wall funds to February, giving lawmakers and the White House another month to negotiate.

The measures were viewed as symbolic efforts as no additional border funds were included. Trump had repeatedly said he would not sign any bill that did not include the $5.7 billion he was requesting to construct the wall.

Jan. 4: Trump's threats

Another meeting with top Democrats at the White House led to Trump teasing two new threats: to keep the shutdown going for possibly years and possibly declaring a national emergency to get the funding he desires for a border wall.

After the meeting, Schumer told reporters that the president threatened to keep the government closed for "months or even years" if he doesn't get the $5.7 billion for a wall.

"We told the President we needed the government open. He resisted," Schumer said. "In fact, he said he would keep it closed for a very long period of time, months or even years."

The president, speaking from the Rose Garden, admitted he'd made the threat and when asked, told reporters that he was also discussing the possibility of declaring a national emergency to go around Congress and get funding for his wall, adding "I can do it if I want."

"We can call a national emergency because of the security of our country, absolutely," Trump said.

Jan. 8: Oval Office address, Dem response

In his first formal Oval Office address, Trump told Americans that a border wall is needed to keep the country safe.

Trump sought to pressure Democrats to agree to his request for $5.7 billion as a condition of ending the government shutdown. He also tried to ramp up support among Republicans who are getting nervous about government workers and others who are feeling the pain of the shutdown.

Trump emphasized humanitarian issues in an apparent appeal to Democrats. But he also spent several minutes discussing what he said was a crime problem stemming from migrants entering the country illegally, although he did not note that migrants commit crimes at lower rates than U.S. citizens.

"To every citizen, call Congress and tell them to finally, after all of these decades, secure our border," Trump said.

In their televised response, Pelosi and Schumer said Trump is using fear to try and achieve his wall at the expense of people who rely on government services.

"President Trump must stop holding the American people hostage, must stop manufacturing a crisis, and must reopen the government," Pelosi said.

Schumer added: "We don’t govern by temper tantrum," explaining "no president should pound the table and demand he gets his way or else the government shuts down, hurting millions of Americans who are treated as leverage."

Jan. 9: Trump storms out of meeting with Dems

Trump started off a meeting with top Democrats by offered candy. Things didn't end as sweet.

Trump walked out of a negotiating meeting with congressional leaders Wednesday and said he might declare a national emergency at the border after Democrats refused to yield to his demands for money for a border wall.

Schumer said Trump abruptly ended the White House session after Pelosi said she did not support his border wall.

"He just got up and said we have nothing to discuss, and he walked out," Schumer said. "He just walked out of the meeting.”

Schumer called Trump's behavior "unbecoming of a president."

Pence and Republican lawmakers disputed the Democrats’ account and said the meeting ended after Democrats refused to offer a counterplan to reopen the government.

Republicans said that Trump offered to reopen the government immediately if Democrats would consider funding the $5.7 billion needed for a border wall. When Pelosi told him no, Trump left the meeting and said it was a waste of time.

Jan. 10: Trump visits southern border; negotiations sour

Trump blasted Democrats and touted his proposed border wall during a visit to Texas on Thursday hours after making his most explicit threat yet to declare a national emergency and sidestep Congress on the issue.

“If we had a barrier of any kind, a powerful barrier, whether its steel or concrete, we would stop it cold,” Trump said of the drugs, crime and human trafficking he has said are pouring into the United States in what the White House increasingly frames as a "crisis."

Trump's trip to McAllen, Texas, came hours after he laid out in his most explicit language yet a threat to bypass Democrats and declare a national emergency to free up additional funding for the border wall.

"If this doesn’t work out, probably I will do it – I would almost say definitely,” Trump said of declaring a national emergency.

While Trump was in Texas, the House worked to pass spending bills to reopen the government. The House passed measures to reopen the Agriculture Department, Department of Transportation and Department of Housing and Urban Development.

They also passed a measure to reopen federal financial agencies, such as the IRS and Treasury Department, both of which are vital to the upcoming tax refund season.

All of the bills aimed to put more pressure on Republicans and the Senate but were seen as symbolic as the president repeatedly said he would veto any measure that didn't include border wall funding.

Prominent lawmakers in Washington also met behind closed doors to find a compromise. Republican Sen. Lindsey Graham held several talks in hopes of coming to some agreement to end the shutdown but they hit a snag.

"I have never been more depressed about moving forward than right now. I just don’t see a pathway forward," Graham said. He later called on Trump to declare a national emergency.

Jan. 16: Pelosi says Trump should delay State of the Union

Pelosi asked the president to reschedule his State of the Union address this month if the government remains shuttered – or deliver it in writing.

"Sadly, given the security concerns and unless government re-opens this week, I suggest that we work together to determine another suitable date after government has re-opened for this address or for you to consider delivering your State of the Union address in writing to the Congress on January 29th," Pelosi wrote in a letter to Trump on Wednesday.

Pelosi cited Homeland Security Secretary Kirstjen Nielsen's designation of State of the Union addresses as a "National Special Security Event," which requires a high level of security. The Secret Service is responsible for such events, but the agency, a part of the Department of Homeland Security, is affected by the shutdown.

House Minority Leader Kevin McCarthy said Trump "has a right" to give the speech and that Americans "have the right" to hear it.

“I think Speaker Pelosi is playing politics like I’ve never seen a speaker before," McCarthy said. "I think it’s unbecoming of the office to disinvite the president."

Jan. 17: Trump hits back, postpones Pelosi's trip

Trump threw a punch back at Pelosi by canceling her military plane for an overseas trip just one day after she suggested postponing his State of the Union address.

“Due to the Shutdown, I am sorry to inform you that your trip to Brussels, Egypt and Afghanistan has been postponed,” Trump wrote in a letter to the California Democrat. “We will reschedule this seven-day excursion when the Shutdown is over.”

Trump didn't address Pelosi's request that he delay the State of the Union but focused instead on her overseas trip, which he called "a public relations event.” Trump said it would be better if Pelosi were in Washington “negotiating with me" to end a partial government shutdown that is nearing its fifth week.

“Obviously, if you would like to make your journey by flying commercial, that would certainly be your prerogative,” he concluded.

Jan. 19: Trump's compromise deal; Dems say no

As the partial government shutdown neared a month, Trump used a White House speech to outline what he called “a common-sense compromise both parties can embrace” that included protections for some undocumented immigrants and money for border security.

“Both sides in Washington must simply come together,” Trump said in a White House speech, saying he is trying to “break the logjam." Defending his plan, he said, "walls are not immoral, in fact they are the opposite of immoral because they will save many lives."

In remarks he billed as a "major announcement," Trump cited a proposal developed by administration officials and Republican lawmakers, one that would grant work permits to certain migrants for three years in exchange for approval of wall funding.

Congressional Democrats, however, said the offer as outlined would not lead to a deal that would end the shutdown, in part because it would allow Trump to pursue an expensive and ineffective wall and did not include permanent protections for immigrants who are living in the U.S. under DACA or temporary protected status.

They pointed out that Trump's decisions put DACA in jeopardy to begin with and the deal was not enough.

"His proposal is a compilation of several previously rejected initiatives, each of which is unacceptable and in total, do not represent a good faith effort to restore certainty to people’s lives," Pelosi said in a statement.

Jan. 23: State of the Union postponed

After a bitter back-and-forth with Pelosi, the president decided to postpone his State of the Union address.

In a pair of late-night tweets, Trump explained that the House Chamber was the only appropriate place for the address, abandoning the search for an "alternative" location that he teased to reporters earlier in the day.

"As the Shutdown was going on, Nancy Pelosi asked me to give the State of the Union Address. I agreed. She then changed her mind because of the Shutdown, suggesting a later date. This is her prerogative - I will do the Address when the Shutdown is over," Trump said.

The announcement came hours after Pelosi wrote a letter, telling Trump that the House would not allow the president to hold the address in the House chamber, where it's traditionally held.

Trump responded by lashing out at Pelosi, telling reporters "the State of the Union speech has been canceled by Nancy Pelosi because she doesn’t want to hear the truth. She doesn't want the American public to hear what's going on."

He later announced he would postpone the address.

Jan. 24: Bills to reopen the government fail but add glimmer of hope

The Senate rejected a pair of dueling bills to fund the federal government. But, the votes marked the first movement in the chamber to break the budget impasse that triggered the shutdown and signaled a possible path toward compromise.

Senators voted down both a GOP bill that would provide $5.7 billion that Trump is demanding to build a wall along the U.S.-Mexico border and other concessions that Trump offered to Democrats over the weekend. They also denied a short-term measure led by Democrats that did not including money for a border wall.

Immediately after the votes, McConnell and Schumer huddled in McConnell’s office to try to figure out a way forward as the bipartisan group of senators took to the floor to push for a bill to open the government through Feb. 15.

The president also signaled he could support a "reasonable" agreement to temporarily reopen the government but stressed he wanted a "down payment" on the wall.

Jan. 25: A deal to end the shutdown

It took 35 days but the record-long shutdown temporarily ended after Trump announced a deal to reopen the government.

"I am very proud to announce today that We have reached a deal to end the shutdown and reopen the federal government," the president said.

The deal reopens the government for three weeks, allows federal workers to get paid again and gives lawmakers a deadline for a deal on border security.

Both the House and Senate approved a bill funding the government until Feb. 15. The president signed the measure late Friday.

But, if a compromise isn't made by Feb. 15, it's unclear what could happen next.

An impasse could mean another government shutdown or the president electing to use executive authority to redirect funds for his border wall.

He hinted at that possibility after announcing lawmakers had a three-week deadline.

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

Contributing: Michael Collins, David Jacksonand Eliza Collins