A three-day US government shutdown came to an end late on Monday after Republicans and Democrats reached an agreement to temporarily fund the government.

US President Donald Trump signed the funding bill, which will keep the government open for 17 days.

The shutdown came late on Friday after the collapse of bipartisan talks on a US spending bill that hinged on continued protections under the DACA programme for undocumented immigrants, which Democrats support.

Monday's bill does not include any provisions on DACA, but Senate Majority Leader Mitch McConnell said he would allow a debate on immigration on a "level playing field at the outset".

While Senate Democrats ultimately accepted McConnell's promise, many, including Elizabeth Warren, Bernie Sanders, Cory Booker and Kamala Harris voted against the measure.

Prior to the shutdown, Beth Ann Bovino, a senior economist at financial ratings agency Standard and Poor's (S&P), said it would deliver a "direct and indirect impact" on the US economy.

The last shutdown was in 2013 and lasted 16 days.

Al Jazeera examined what effect a government shutdown has on the US.

What's the direct impact?

The direct impact, Bovino explained, would be an immediate loss of productivity from about 700,000 government employees deemed "nonessential".

These workers will be "furloughed", meaning they will be put on leave until the government resumes functioning.

While there is no guarantee government workers will be paid for this leave, historically they have been paid retroactively in the case of a shutdown.

Even if they are paid, the US government will experience "lost productivity" from almost a million people, Bovino said.

The time spent not working on ongoing initiatives will "never come back", the economist continued.

How are people affected?

National parks, museums and monuments are expected to shut down, as will the processing of passports and visas.

This will impact tourism. National parks in the west and the Smithsonian Institute museums in the east will not open to the public.

{articleGUID}

Another indirect loss will be to contractors - government employees are not the only ones waiting for a paycheck from Uncle Sam.

Over $43bn has been awarded in contracts for the fiscal year 2018, according to government figures.

None of this money will be paid as long as the shutdown continues. That will remove a fair amount of money from the pockets of private citizens throughout the country.

Retail sales would drop.

"It's not quite the height of the holiday season, so that suggests the impact would be less severe. However, when we look at holiday sales, they continue into January," Bovino said.

Which government services continue?

Those related to national security and domestic safety, including the military, law enforcement and air traffic control.

{articleGUID}

Certain entitlements, such as hospitals for veterans administered by the government and food stamps for families in need, would be unaffected.

Federal courts, where the Trump administration is currently battling an order to undo his decision to end the DACA programme, will continue but are subject to disruption.

How long have past shutdowns lasted?

In the case of the 16-day 2013 shutdown, Republicans and Democrats were at odds over funding then-President Obama's landmark healthcare law, known as Obamacare, and the US "debt ceiling," which allows the US Treasury to continue borrowing to pay debts.

There was a 27-day shutdown from December 1995 to January 1996, resulting from a clash between Republicans and Democrats over funding a health insurance programme for the elderly. That came a month after a November shutdown that lasted four days.

Before these examples, shutdowns were rare.

The US government typically only experienced funding gaps over the weekend, not impacting the economy in any major way, according to data from the Committee for a Responsible Federal Budget, a think-tank in Washington, DC.

What is the cost to the economy?

The 2013 shutdown cost the US economy $24bn, according to estimates from S&P. While costly, GDP was over $16 trillion that year.

The firm estimates a shutdown would cost the US economy about $6bn per week in 2018.

Any losses this early in the year could be regained later, Bovino said.