The longest government shutdown in the nation’s history ended Friday after Congress and President Donald Trump agreed to a bill to reopen the government for three weeks.

The deal funds the government until Feb. 15, giving lawmakers time to negotiate a more permanent agreement on border security.

The shutdown began Dec. 22 when Democrats and Trump found themselves at an impasse over the $5.7 billion the president wants for a border wall. This amount is about 0.5 percent of the government’s discretionary spending each year and 0.1 percent of the nation’s total annual budget.

Approximately 380,000 federal employees were furloughed during the shutdown. Another 420,000 worked without pay.

The shutdown marked the 21st time the federal government has shuttered since 1976, when Congress enacted the modern-day budget process.

The first shutdowns came the very next year, when the government closed on three separate occasions for a total of 28 days.

Before this year, the record for the longest shutdown was 21 days. It took place in 1995, when President Bill Clinton and House Speaker Newt Gingrich found themselves at odds an impasse over domestic spending cuts.

How shutdowns happen

Government funding is designed to work through an annual process, with Congress passing a dozen different year-long appropriations bills designating funds by for each agency and program. The House and Senate must finish the appropriations process by Oct. 1, the start of the new fiscal year.

When Congress doesn’t meet that deadline, the government goes into a partial or full shutdown, depending on the number of agencies that still need funding. Sometimes funding gaps only last a few hours and do not last long enough to affect government operations.

That is what happened last February. Congress passed a spending bill nine hours after the funding deadline passed.

When shutdowns extend into work hours, non-essential federal employees are furloughed and a number of government operations, such as the process that verifies workers’ legal status, halt.

Which services stop also depends on whether it’s a partial or full government shutdown. Currently Congress has funded about three-fourths of the government, so the ongoing budget impasse is technically a partial government shutdown.