We are currently in the middle of the longest-running government shutdown in American history. With 22 full days down as of Sunday January 13, and no clear end in sight, the 2018-’19 shutdown has outlasted 1995’s (which ended after 21 days), previously the longest by a wide margin.

The partial shutdown began on December 22, 2018, with President Donald Trump’s demand for $5 billion to pay for his much-promised full-length border wall with Mexico, and while both parties in Congress had floated $1.6 billion as a compromise, Trump rejected it. His $5 billion isn’t enough for a full wall, but would block off 215 additional miles that are currently unfenced (in addition to the 120 miles the administration is currently building with existing funds). Most recently Democrats offered a spending package that would maintain current funding levels for border security, which Trump rejected out of hand.

In the meantime, some 420,000 federal workers are working without pay; another 380,000 are furloughed without pay; tax refunds might be delayed; and payments for Women and Infant Children (WIC) could soon be cut for lack of funds.

Government shutdowns are familiar to most Americans, but they’re a relatively recent development. They first began as the result of the Congressional Budget Act of 1974. Since then, Congress has failed to authorize funding for the federal government on 21 separate occasions.

The first six of those didn’t actually affect the functioning of government at all. It wasn’t until a set of opinions issued by Attorney General Benjamin Civiletti in 1980 and ’81 that the government started treating “funding gaps”— periods when Congress has failed to allocate funds for the ongoing functions of government — as necessitating the full or partial shutdown of government agencies.

Here are all 20 funding gaps prior to the current one, and why they happened. When not otherwise cited, the explanations below come courtesy of this helpful piece by some dude named Dylan Matthews.

Shutdown 1: September 30 to October 11, 1976

President: Gerald Ford

Senate: Democrats (62-38), Majority Leader Mike Mansfield

House: Democrats (291-144), Speaker Carl Albert

Why: Ford vetoed a funding bill for the Departments of Labor and Health, Education, and Welfare (which has since been divided into the Department of Education and the Department of Health and Human Services). That alone didn’t cause a funding gap because Democrats rapidly overrode his veto, but it took until October 11 for Congress to pass a continuing resolution funding the rest of the government, whose funding had lapsed amid the HEW/Labor funding fight.

Shutdown 2: September 30 to October 13, 1977

President: Jimmy Carter

Senate: Democrats (59-41), Majority Leader Robert Byrd

House: Democrats (292-143), Speaker Tip O’Neill

Why: The Senate wanted to loosen restrictions on the use of Medicaid dollars to cover abortions (restrictions known informally as “the Hyde Amendment”), by allowing funding in cases of rape, incest, and when the health of the mother is in danger; at the time, only abortions necessary to save the life of the mother were funded. The House, however, insisted on maintaining the stricter ban.

The issue was addressed in amendments to a bill funding the Labor and HEW departments. The two houses couldn’t agree to a deal by the September 30 deadline, prompting a funding gap at the two departments. The gap ended when Congress agreed to punt the abortion issue to October 31.

Shutdown 3: October 31 to November 9, 1977

President: Jimmy Carter

Senate: Democrats (59-41), Majority Leader Robert Byrd

House: Democrats (292-143), Speaker Tip O’Neill

Why: Punting the abortion dispute didn’t work! It came back. This gap ended when Carter signed yet another short-term extension.

Shutdown 4: November 30 to December 9, 1977

President: Jimmy Carter

Senate: Democrats (59-41), Majority Leader Robert Byrd

House: Democrats (292-143), Speaker Tip O’Neill

Why: Congress still didn’t agree on abortion funding. But the dispute was eventually resolved and funding extended to cases of rape, incest, and mother’s health. Four years later, when Reagan took office, that funding was once again taken away.

Shutdown 5: September 30 to October 18, 1978

President: Jimmy Carter

Senate: Democrats (59-41), Majority Leader Robert Byrd

House: Democrats (292-143), Speaker Tip O’Neill

Why: The first Carter shutdown not about abortion! Well, not entirely about it; that did factor into a dispute about HEW funding. But beyond that, Carter vetoed a defense spending bill because it funded a nuclear-powered aircraft carrier he considered wasteful, and a public works bill because of projects he considered pork. Carter ultimately prevailed, and funding for the carrier and the projects he opposed was stripped. The rape/incest/mother’s health exceptions on abortion were retained.

Shutdown 6: September 30 to October 12, 1979

President: Jimmy Carter

Senate: Democrats (58-42), Majority Leader Robert Byrd

House: Democrats (277-158), Speaker Tip O’Neill

Why: Abortion, again — the House wanted to return to only allowing one exception, for the mother’s life, and the Senate wanted to retain a looser standard. The House also wanted higher pay for congressional and civil service staff. It got that change enacted but had to accept funding for abortions in the case of rape and incest (but not when the mother’s health is at risk).

Shutdown 7: November 20 to 23, 1981

President: Ronald Reagan

Senate: Republicans (53-47), Majority Leader Howard Baker

House: Democrats (244-191), Speaker Tip O’Neill

Why: This was the first shutdown, in the current sense of the term, when federal government functions were seriously curtailed. Reagan furloughed 241,000 federal workers, the first time a funding gap had led to so severe a reduction in the federal government’s operations. Reagan had demanded $8.4 billion in domestic spending cuts and promised to veto any bill that didn’t include at least half of that amount in cuts. The Senate was willing to comply, but the House insisted on bigger defense cuts and on pay increases for itself and the civil service.

The two branches reached a deal that fell $2 billion short of Reagan’s threshold, so he vetoed the deal and shut down the government. The shutdown ended quickly after Congress passed a continuing resolution for a little less than a month, giving them time to negotiate.

Shutdown 8: September 30 to October 2, 1982

President: Ronald Reagan

Senate: Republicans (53-47), Majority Leader Howard Baker

House: Democrats (244-191), Speaker Tip O’Neill

Why: This one literally happened because Reagan and Congress had social engagements and forgot to keep funds flowing in the meantime. I swear to God. Here’s Martin Tolchin writing in the New York Times:

Congress missed the deadline tonight for action on a catch-all spending bill needed to finance the Government in the next two and a half months, even though House and Senate conferees adopted a compromise measure resolving differences in the legislation approved by each chamber. The House and Senate will not act on the measure until Friday. Congressional leaders barred a late-night session because of major social events tonight by both Republicans and Democrats. President Reagan invited all members of Congress to a barbecue at the White House, while Democrats were having a $1,000-a-plate fund-raising dinner.

Shutdown 9: December 17 to 21, 1982

President: Ronald Reagan

Senate: Republicans (53-47), Majority Leader Howard Baker

House: Democrats (244-191), Speaker Tip O’Neill

Why: This dispute concerned money both the House and Senate wanted for a public works jobs program, which Reagan threatened to veto. The House also wanted to block funding for the MX and Pershing II missile programs, which were major defense priorities for Reagan. Reagan grudgingly signed a funding bill that didn’t fund the missiles, increased foreign aid to Israel beyond the level he requested, and added funding for the Legal Services Corporation, which offers civil legal services to poor Americans and which Reagan had wanted to eliminate.

Shutdown 10: November 10 to 14, 1983

President: Ronald Reagan

Senate: Republicans (55-45), Majority Leader Howard Baker

House: Democrats (271-164), Speaker Tip O’Neill

Why: A variety of issues this time: House Democrats wanted more education funding, more aid for Israel and Egypt, less aid to Syria and El Salvador, and less defense spending than Reagan did. The two parties reached a compromise in which the MX missile was funded, and Democrats got a lot less money for education and secured their defense and foreign cuts, along with a ban on oil and gas drilling on federal animal refuges.

Shutdown 11: September 30 to October 3, 1984

President: Ronald Reagan

Senate: Republicans (55-45), Majority Leader Howard Baker

House: Democrats (270-165), Speaker Tip O’Neill

Why: Reagan wanted a crime bill; House Democrats wanted water projects and a law reversing a recent Supreme Court decision allowing exemptions from Title IX of the Civil Rights Act for colleges that didn’t get federal funding directly but whose students did. Reagan didn’t like the latter two provisions, and a three-day spending extension was passed to give more time to negotiate after the funding gap.

Shutdown 12: October 3 to 5, 1984

President: Ronald Reagan

Senate: Republicans (55-45), Majority Leader Howard Baker

House: Democrats (270-165), Speaker Tip O’Neill

Why: Three days wasn’t long enough! And this time, 500,000 workers were furloughed. Ultimately, the Democrats relented on all three issues — the crime bill, the civil rights bill, and the water projects — and even acquiesced to temporary funding for Nicaragua’s anti-communist Contra guerrillas.

Shutdown 13: October 16 to 18, 1986

President: Ronald Reagan

Senate: Republicans (53-47), Majority Leader Bob Dole

House: Democrats (253-182), Speaker Tip O’Neill

Why: House Democrats were pushing a number of White House-opposed provisions, including expansion of Aid to Families With Dependent Children, the name used at the time for welfare. They were promised a vote on the welfare expansion and a concession relating to the government’s privatization of the railway Conrail, and in exchange passed a funding bill. About 500,000 workers were furloughed for half a day.

Shutdown 14: December 18 to 20, 1987

President: Ronald Reagan

Senate: Democrats (54-46), Majority Leader Robert Byrd

House: Democrats (258-177), Speaker Jim Wright

Why: Congressional Democrats were resisting further funding for the Contras in Nicaragua, and insisted on reinstating the Fairness Doctrine, a Federal Communications Commission rule that had recently been abandoned, which required broadcasters to show balanced perspectives on political issues. Democrats lost on the Fairness Doctrine, and agreed to “nonlethal” aid to the Contras.

Shutdown 15: October 5 to 9, 1990

President: George H.W. Bush

Senate: Democrats (55-45), Majority Leader George Mitchell

House: Democrats (258-176), Speaker Tom Foley

Why: Bush pledged to veto any continuing resolution that did not come with a plan to reduce the deficit. The House tried to override his veto and failed, forcing a shutdown in which millions of workers were furloughed. The House and Senate agreed to a joint budget resolution outlining a declining deficit, and Bush signed a continuing resolution.

Shutdown 16: November 13 to 19, 1995

President: Bill Clinton

Senate: Republicans (53-47), Majority Leader Bob Dole

House: Republicans (233-199), Speaker Newt Gingrich

Why: Gingrich and Dole sent Clinton a continuing resolution including hikes to Medicare premiums, rollbacks of environmental regulations, and a requirement to balance the budget within seven years. Clinton vetoed it, and the government went into shutdown. The shutdown ended with a deal among the three leaders to fund the government at 75 percent levels for four weeks so that negotiations could keep going. Clinton acceded to the seven-year balanced budget requirement. About 800,000 employees were furloughed.

Shutdown 17: December 16, 1995, to January 6, 1996

President: Bill Clinton

Senate: Republicans (53-47), Majority Leader Bob Dole

House: Republicans (235-198), Speaker Newt Gingrich

Why: This shutdown, which lasted the better part of a month, was all about whether to use economic forecasts from the Congressional Budget Office or the Office of Management and Budget to determine whether the White House’s budget plan would balance. The CBO was more cautious, and projected that Clinton would still have a $115 billion deficit in seven years under his plan. Republicans eventually caved after 21 days, and Clinton then proposed a plan that the CBO agreed balanced the budget. Some 284,000 workers were furloughed, in the longest shutdown in history.

Shutdown 18: October 1 to 17, 2013

President: Barack Obama

Senate: Democrats (54-46), Majority Leader Harry Reid

House: Republicans (232-200), Speaker John Boehner

Why: Ted Cruz, basically. While House Republicans, led by Boehner, had pressured the White House into agreeing to lower levels of discretionary spending, and conservatives in the House led by Rep. Tom Graves (R-GA) demanded that any funding bill delay implementation of Obamacare by a year. It was set to roll out the following year, and conservatives, most vocally led by Cruz and Heritage Action, were desperate to stop it before it gained beneficiaries who could defend it politically. Enough House conservatives got on board with the plan to make it impossible to pass a continuing resolution, and the government shut down.

After 17 days, Boehner folded and passed a funding bill that did not defund Obamacare and that most of his caucus opposed. Roughly 850,000 workers, or about 40 percent of the federal workforce, were furloughed.

Shutdown 19: January 20 to 22, 2018

President: Donald Trump

Senate: Republicans (51-49), Majority Leader Mitch McConnell

House: Republicans (238-193), Speaker Paul Ryan

Why: This one was over immigration. As Vox’s Andrew Prokop explained at the time, Democrats, spurred on by outside activists, wanted to force the Trump Administration and Congress to protect beneficiaries of DACA (Deferred Action for Childhood Arrival), which barred deportation of unauthorized immigrants who came to the US as kids, after the Trump administration decided to end the program. Because Democrats easily had enough votes to filibuster a funding bill in the Senate, they (and a handful of Republican senators who also voted no) were able to block a bill lacking protections for DACA recipients and force a shutdown.

But they folded relatively quickly after that, agreeing to fund the government (and the Children’s Health Insurance Program, which was also up for renewal) after Majority Leader McConnell promised to hold a vote on an immigration bill.

Shutdown 20: February 9, 2018

President: Donald Trump

Senate: Republicans (51-49), Majority Leader Mitch McConnell

House: Republicans (238-193), Speaker Paul Ryan

Why: ﻿The second shutdown of the Trump years was a Rand Paul special. Indeed, calling it a “shutdown” is kind of generous, as it only lasted a few hours and mostly involved Paul forcing his colleagues to stay until nearly 6 in the morning.

But in any case, Paul was angry that congressional leaders had negotiated a deal to exceed budget caps adopted as part of the 2011 fiscal cliff deal. Most Republicans accepted the deal as a necessary price of getting higher defense spending, but Paul, among the most dovish Republicans in the chamber, is a fierce critic of defense spending too.

So Paul filibustered the bill, delaying passage to 5:30 am and technically causing a brief shutdown, even though there were easily enough votes in the Senate to pass the bill.