As the nation stands bitterly, even violently, divided with weeks to go before a hotly contested presidential election, another tremor hits when a Supreme Court justice of three decades dies. 

This leaves the Republican president and fierce rival of the departed, Democrat-appointed justice to fill the vacancy.

In this instance, the Supreme Court was not at the top of President Abraham Lincoln’s priorities when Chief Justice Roger Taney died 27 days before the election of 1864. 

To this day, this is the closest to Election Day that a high court vacancy has occurred. 

Win or lose reelection, Lincoln’s term wouldn’t expire until March 1865, so the prospect of a long lame-duck presidency loomed in those pre-20th Amendment days. 

After winning reelection, Lincoln in December nominated his former treasury secretary, Salmon Chase, to fill the vacancy on the Supreme Court. The Republican-controlled Senate confirmed Chase that same month. 

Taney, the justice whom Chase succeeded, was confirmed by the Senate in March 1836, during an election year, but President Andrew Jackson had nominated him back in July 1835. 

Of the 29 times a Supreme Court vacancy has occurred in an election year, 22 different presidents nominated a replacement—either before the election or in the lame-duck period before the next presidential inauguration. 

That total soon will be 30, as President Donald Trump is poised by this Saturday to nominate a successor to Justice Ruth Bader Ginsburg, who died Friday at 87, just 46 days before the Nov. 3 election. 

Here’s what to know about Supreme Court confirmations in presidential election years. 

1. What Happens When President’s Party Controls the Senate?

Of those 29 times a vacancy on the high court occurred in an election year, 19 presidents nominated a successor when their party controlled the Senate. In those cases, the Senate majority party confirmed their president’s nomination 17 times.      

Most of those nominations, a total of 10, occurred before Election Day. The rest occurred after, during what is traditionally called the lame-duck session. All but one pre-Election Day nominee were confirmed. 

The exception came in 1968, when President Lyndon Johnson, a Democrat, nominated Justice Abe Fortas to be chief justice. 

Chief Justice Earl Warren had announced he would retire, but remain on the court until a successor was confirmed. Fortas became engulfed in a financial scandal, prompting a bipartisan group of senators to stall a vote even though Democrats controlled the chamber. 

Johnson also was poised to nominate Homer Thornberry to fill the court vacancy created when Fortas moved up, but did not proceed because no vacancy occurred.  

Like Johnson, other incumbent presidents—Barack Obama, Millard Fillmore, James Buchanan, and Andrew Jackson—made high court nominations in election years when they weren’t running for reelection. 

2. How Many Presidents Nominated Justices While Running for Reelection?

This is the situation Trump is in today. In nearly every other case, like this one, the president’s party also controlled the Senate.

The last time an incumbent president facing reelection nominated a Supreme Court justice was in 1940. It took President Franklin Roosevelt just 11 days to get the Democrat-controlled Senate to confirm Frank Murphy in January to replace Justice Pierce Butler, who had died the previous November.

Besides Roosevelt, three other 20th-century presidents made Supreme Court nominations when running for reelection when their party controlled the Senate, and all three were successful. 

President William Howard Taft nominated Mahlon Pitney, who was confirmed by a Republican-controlled Senate in 1912 before Taft lost the election.

President Woodrow Wilson, Taft’s successor, in 1916 won confirmations in a Democrat-controlled Senate of two new justices, John Clarke and Louis Brandeis. Wilson was reelected. 

President Herbert Hoover, a Republican, lost to Roosevelt by a landslide in 1932. But Hoover won confirmation of Justice Benjamin Cardozo from a Republican-controlled Senate before an ugly Election Day for the Republican Party.

The first-ever such case might be a questionable example because President George Washington was elected twice by acclamation. But Washington technically was in a reelection year when he nominated two men for the Supreme Court in 1796, both of them confirmed promptly by the Senate. 

Washington nominated Oliver Ellsworth to be chief justice and Samuel Chase as associate justice. The Federalists, a faction most closely associated with Washington, controlled the Senate at the time. 

President Thomas Jefferson’s Democratic-Republicans controlled the Senate when he was up for reelection in 1804 and nominated William Johnson in March. The Senate confirmed Johnson that same month. Jefferson was reelected late that year.

President Benjamin Harrison nominated George Shiras to the high court when his fellow Republicans held a Senate majority and they confirmed Shiras in July 1892. Harrison lost his reelection bid. 

Four years earlier, Democrat Grover Cleveland convinced a Republican Senate to confirm Melville Fuller as chief justice in the middle of the 1888 presidential election campaign. Cleveland lost reelection. 

3. What Happens When the Opposition Party Controls the Senate?

Of the 10 times a president nominated a justice when the opposing party controlled the Senate, only two of the nominees were confirmed. Of those instances, the president nominated a replacement before Election Day six times.

The most recent example, of course, was President Barack Obama’s nomination of Merrick Garland to fill the vacancy of Justice Antonin Scalia, who died in February 2016. 

The Republican-controlled Senate declined to hold a confirmation hearing for Garland. Trump, as the new president elected that November, successfully nominated Neil Gorsuch.

The Whig-controlled Senate shot down four of President John Tyler’s five high court nominees in 1844. But it confirmed Samuel Nelson as a justice during the lame-duck session of February 1845. Tyler and the Whig Congress were fierce opponents. 

President Millard Fillmore had three nominations rejected by the Senate in 1852.

Two other presidents whose party was out of power in the Senate failed to get high court nominees confirmed in the lame-duck session. These were John Quincy Adams in 1829 and James Buchanan in 1861.

Republican Rutherford B. Hayes, elected president in 1876 in a controversial outcome, saw his party lose the Senate. In the lame-duck session in early 1881, Hayes secured one confirmation to the Supreme Court (Stanley Matthews) but lost another (William Woods). 

In a case that overlaps categories with regard to an election year, President Dwight Eisenhower faced a Democrat-controlled Senate in 1956. 

In what was reported as an appeal to the Catholic vote, Eisenhower recess-appointed William Brennan to the high court in October 1956, shortly before his landslide reelection. The Democratic Senate confirmed Brennan in March 1957. 

In another case that doesn’t easily fit, President Ronald Reagan nominated Anthony Kennedy to the Supreme Court in November 1987, after two previous failed nominations to fill the seat of Justice Lewis Powell, who retired in June 1987. The Democratic Senate confirmed Kennedy in February 1988.

4. What Presidents Made Lame-Duck Picks After the Election?

The most consequential lame-duck nomination was President John Adams’ successful appointment of fellow Federalist John Marshall to be chief justice in January 1801, after Adams lost reelection to Jefferson. 

In his final days as president in March 1837, Jackson, a two-term Democrat, secured Senate confirmations of  two high court nominees, John Catron and William Smith. 

Jackson’s successor, Democrat Martin Van Buren, lost his reelection bid in 1840, but managed to get the Democratic Senate to confirm his nominee, Peter Daniel, to the high court in February 1845.

After winning reelection in 1872, President Ulysses S. Grant nominated Ward Hunt to the Supreme Court, and saw him confirmed by the Republican-controlled Senate that December. 

After losing reelection, Benjamin Harrison nevertheless got Howell Jackson confirmed for the high court in February 1893. 

And after winning reelection to a full term, President Calvin Coolidge named Justice Harlan Stone in January 1925. He was confirmed the next month.