WASHINGTON — President Donald Trump and Congress failed to reach an agreement on a spending plan by midnight Friday, triggering a partial shutdown of the federal government. Government shutdowns are unusual but not unheard of. The government has partially shut down three times in the past quarter-century — and far more often in decades past.

Shutdowns have led to furloughs of several hundred thousand federal employees, required many government activities to be stopped or curtailed and affected wide swaths of the economy.

During Jimmy Carter’s administration, shutdowns happened nearly every year, averaging 11 days each. During Ronald Reagan’s two terms in the 1980s, there were six shutdowns, typically just one or two days apiece.

Legal opinions issued in 1980 and 1981 made shutdowns more impactful. Opinions by then-Attorney General Benjamin Civiletti determined that failure to pass new spending bills required government functioning to shut down in whole or in part. Earlier “shutdowns” did not always entail an actual stop to government functioning and often were simply funding gaps will little real-world effect.

Here’s a look at recent shutdowns, their causes and impact:

— October 2013. Sixteen-day partial shutdown, which came as tea party conservatives, cheered on by outside groups, demanded that language to block implementation of President Barack Obama’s health care law be added to a must-do funding bill. Then-Speaker John Boehner, R-Ohio, tried to avoid a shutdown by funding the government piecemeal, but the effort faltered.

The shutdown affected most government operations and resulted in the furlough of 850,000 employees, costing the government 6.6 million days of work and more than $2.5 billion in lost productivity, according to a report by the Congressional Research Service. Boehner survived the shutdown but stepped down two years later amid conflict with the hard-right House Freedom Caucus.

— December 1995-January 1996. Republicans led by then-Speaker Newt Gingrich, intent on slashing the budget, forced a three-week shutdown in a bid to coerce President Bill Clinton to sign onto a balanced budget agreement. Republicans were saddled with the blame, but most Americans suffered relatively minor inconveniences such as closed parks and delays in processing passport applications. The fight bolstered Clinton’s popularity and he sailed to re-election that November.

— November 1995. Five-day shutdown after Clinton vetoed an interim spending bill to block Medicare premium increases. Led to longer shutdown a month later.