Key parts of the US government shut down on December 22 after President Donald Trump and Democratic politicians hit an impasse over the president's request for $5bn in funding for a wall on the US-Mexico border, a demand Democrats oppose.

On January 25 - 35 days into the shutdown - Trump announced he had reached a tenative deal with congressional leaders to reopen the government for three weeks while talks on the border wall continued.

The deal, once signed, would end the longest government shutdown in US history.

Here's a lookback at how the US got here and who was affected by the shutdown:

What departments are affected? What does the shutdown mean for federal workers?

The shutdown affects more than 800,000 federal workers in nine different departments, as well as several federal agencies. This includes the departments of Agriculture, Commerce, Justice, Homeland Security, Housing and Urban Development, Interior, State, Transportation and Treasury.

Federal workers deemed "essential" are required to work without pay. Others are furloughed, or placed on temporary leave.

Federal employees have sued the US government over the requirement that some workers must work without pay. After past government shutdowns, Congress has approved back pay for federal workers, but the American Federation of Government Employees, which launched the recent lawsuit, called the requirement to work without pay "inhumane".

The Internal Revenue Service (IRS) has stopped many of its services, but officials said the agency would continue issuing tax refunds.

Immigration courts have also been affected, worsening an already existing backlog, which includes more than 800,000 cases.

According to Democratic Representative Sharice Davids, who was recently sworn in, the shutdown has had a direct effect on Native Americans' lives.

"I spoke with one tribal leader who said that they actually lost a tribal member because they were unable to plough the roads so that an emergency service vehicle could get to him in time," Davids recently told National Public Radio (NPR).

Davids explained that federal funds that go to tribal communities for services such as ploughing roads and healthcare have stopped due to the shutdown.

On January 2, the Smithsonian museums and National Zoo in Washington, DC, closed due to the shutdown. Some national parks have also closed or have limited services.

Many of the thousands of federal workers affected by the shutdown have expressed anxiety over not receiving their paycheques.

In Detroit, federal worker Gregory Simpkins told the Associated Press, "Next week, it's going to be a panic mode. How are we going to pay rent? How are we going to pay out bills? How in the hell are we going to eat?"

Unions representing workers have led protests throughout the country, demanding an end to the shutdown.

While the effect of the shutdown is not felt by most Americans, millions could be hit if it does not end by February.

Citizens and resident of the US who are part of the Supplemental Nutrition Assistance Program (SNAP) may have their assistance disrupted in March.

Department of Agriculture (USDA) officials have said SNAP beneficiaries will continue to receive assistance through February, but they could not make any guarantees if the shutdown continued into the following month.

On December 28, the USDA noted that other programmes may continue to operate on money that is currently available but will receive no new federal funding during the shutdown.

"Most other domestic nutrition assistance programmes, such as the Commodity Supplemental Food Program, WIC, and the Food Distribution Program on Indian Reservations, can continue to operate at the State and local level with any funding and commodity resources that remain available. Additional Federal funds will not be provided during the period of the lapse, however, deliveries of already-purchased commodities will continue," USDA said.

Why did the shutdown begin?

The shutdown began after Trump and Democrats failed to come to an agreement on whether to allocate funds to a wall on the US southern border.

The president requested $5.7bn be added to new federal spending legislation that needed to be passed before the previous spending expired on December 21.

The Democrats vehemently opposed the demand but after Trump refused to give it up, the shutdown went into effect the following day.

What does Trump say? What do other Republicans say?

Trump maintains that the wall is needed to secure the US southern border with Mexico and stem irregular immigration.

Trump often evokes rhetoric aimed at sowing fear over thousands of Central Americans who, at the end of last year, fled their home countries in hopes of applying for asylum in the US. Many of those who have left have told Al Jazeera they are fleeing violence, political persecution and extreme poverty.

Trump's demand for a border wall funding comes in addition to several other measures aimed at restricting asylum seekers and immigration under the administration's "zero tolerance" policy.

During the shutdown, Trump repeatedly blamed the Democrats and has threatened to declare a national emergency to get the wall built, a move that would likely bring about legal challenges.

In a televised address on January 8, Trump did not mention a national emergency, but branded the situation on the border a "humanitarian crisis, a crisis of the heart and a crisis of the soul".

He has since said he could still declare an emergency, but he wasn't going to "so fast".

During a meeting with top Democrats before the shutdown began, Trump said he would be "proud" to shut the government for "border security". He has since warned that he is prepared for the shutdown to last years, and he told top Democrats he would "look foolish" if he backed down from his demand.

On January 9, Trump walked out a meeting with Democrats after they said they still would not give him money for a border wall if he ended the shutdown.

"I asked what is going to happy in 30 days if I quickly open things up, are you going to approve Border Security which includes a Wall or Steel Barrier? Nancy said, NO. I said bye-bye, nothing else works!" Trump wrote on Twitter.

Although he has stood firm on his demand for the $5.7bn in wall funding, on January 6, Trump said he will accept a metal concrete structure instead of a concrete wall. The president is also contemplating whether to declare a national emergency in order to circumvent Congress and obtain the needed funds from elsewhere. The move, which Trump has said he's not ready to do "so fast" would likely be challenged in the courts.

Trump met congressional Republicans on January 9 to shore up support for border security. He told reporters that the party is "totally unified", despite signs from within the Republican caucus that some worry about the effect of shutdown is having on Americans.

On January 14, Trump rejected a proposal by Republican Senator Lindsey Graham who encouraged Trump to reopen the government for three weeks to allow for talks to continue on the border wall. If talks failed after those three weeks, Graham said, Trump could go ahead and declare a national emergency to bypass Congress and get money for the wall.

Less than a week later, Trump proposed exchanging temporary protections for young undocumented immigrats brought to the US as children and Temporary Protected Status (TPS) holders for his border wall funding. Democrats rejected the proposal, calling it "inadequate".

Trump has also postponed his annual State of the Union address after the Democrats withdrew the House's invitation to speak in the chamber due to the shutdown.

Senate Majority Leader Mitch McConnell, who has so far this year refused to bring legislation that Trump won't sign to the floor for a vote, is facing increased pressure from within his party, especially from vulnerable Republicans up for re-election in 2020, to find a solution.

"We should pass a continuing resolution to get the government back open. The Senate has done it last Congress, we should do it again today," US Senator Cory Gardner told The Hill during the second week of the shutdown, referring to legislation to open the government while talks continue.

His colleague, Susan Collins, also called for the Senate to pass the funding bills, while several other Republicans urged an end to the shutdown, the Hill and New York Times reported.

What do Democrats say? What is their plan?

Democrats view a border wall as expensive and ineffective.

Speaker of the House Nancy Pelosi has called the wall "immoral". Instead, they said they are willing to fund security measures that do not include the wall.

Hours after Democrats took control of the House on January 3, they passed a two-bill spending package aimed at immediately re-opening the government. This includes $1.3bn for border fencing and $300m for other border security items such as technology and cameras.

They have since passed a number of individual spending bills aimed at opening specific federal departments. Those bills have not been brought to a vote in the Senate.

Democrats blame Trump for the impasse, often referring to it as "Trump Shutdown".

In an MSNBC interview shortly after taking control of the House of Representatives, Pelosi sought to separate the issue of the wall and government funding.

"The wall and the government shutdown really have nothing to do with each other," the top Democrat said, adding that it was "totally irresponsible" to think otherwise.

"There is no reason to have workers pay a price with their paycheque," she said during the network's town hall broadcast.

Senate Minority Leader Chuck Schumer said he pressed the president on why he wouldn't end the shutdown.

"I said, 'Mr President, give me one good reason why you should continue your shutdown,' Schumer told reporters in early January. "He could not give an answer."

In a rebuttal to Trump's January 8 address, Pelosi and Schumer accused Trump of dealing in "fear, not facts".

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

Have there been other shutdowns?

There have been 21 federal government shutdowns since the modern budgeting process began. The reasons have varied from disagreements over abortion to Obamacare, among others.

A list of the shutdowns*:

Under President Trump (Republican): December 2018 - January 2019: Ongoing February 2018: One day January 2018: Three days

Under President Barack Obama (Democrat): October 2013: 16 days

Under President Bill Clinton (Democrat): December 1995 - January 1996: 21 days November 1995: Five days

Under President George HW Bush (Republican): October 1990: Three days

Under President Ronald Reagan (Republican): December 1987: One day October 1986: One day October 1984: One day September - October 1984: Two days November 1983: Three days December 1982: Three days September - October 1982: One day November 1981: Two days

Under President Jimmy Carter (Democrat): September - October 1979: 11 days September - October 1978: 18 days November - December 1977: Eight days October - November 1977: Eight days September - October 1977: 12 days

Under President Gerald Ford (Republican): September - October 1976: 10 days



*Includes full and partial days