Amy Coney Barrett became the newest Supreme Court justice Monday after a nighttime swearing-in ceremony outside the White House. Even before her first day on the bench, she is a nominee for the record books — only the fifth woman ever appointed to the high court, the first nominee appointed this close to an election and the rare justice to make public remarks after being sworn in.

One more thing: She’s the first Supreme Court nominee in 150 years to be confirmed in the Senate along a strict party-line vote, according to an analysis by the National Journal. Not even Sen. Joe Manchin III (D-W.Va.), who voted for President Trump’s other Supreme Court nominees, voted to confirm Barrett.

The last time this happened was during another period when political parties were bitterly divided: Reconstruction.

It’s a tangled story spanning three presidencies. First, Abraham Lincoln appointed lawyer Edwin Stanton as his secretary of war in 1862.

Stanton was kind of an annoying micromanager, which caused him to butt heads with Union generals and even Lincoln, but he oversaw the prosecution of the war with considerable skill. He was an honest man in corrupt times, and although he started his career as a Democrat, his increasing opposition to slavery led him to ally himself with radical Republicans on Capitol Hill, especially after Lincoln’s assassination.

President Andrew Johnson, Lincoln’s successor, was a Democrat, a Southerner and an enslaver. Stanton stayed on as his war secretary, but the two men despised each other.

Meanwhile, Republicans had an overwhelming majority in Congress after war, and they wanted to impose strict terms on defeated Confederates before they would be allowed back into the Union. Plus, they worked to limit Johnson’s power. During the Lincoln years, Congress had expanded the Supreme Court from nine to 10 seats.

Now they sought to decrease it to seven (by attrition) to prevent Johnson from appointing anyone. They also passed the Tenure of Office Act, over Johnson’s veto, limiting his power to remove civil officers from his own administration.

When Johnson tried to remove Stanton, he refused to leave, citing the Tenure of Office Act. The House voted overwhelmingly to impeach the president; he escaped removal at the subsequent Senate trial by a single vote. Stanton had no choice but to step down in May 1868.

He wasn’t out of a job for long, though. Union Gen. Ulysses S. Grant won the 1868 election. As soon as Grant took office in 1869, the Republican Congress decided to go back to nine justices, and, in an unprecedented move, a majority of the House and the Senate signed a petition recommending that Grant nominate Stanton. He did.

The vote to confirm Stanton — hated by the South, lauded in the North — went down along strict party lines, 46 to 11, on Dec. 20, 1869. Not a single Democrat supported him.

But Stanton had been struggling with asthma and other illnesses for several years, and before he could be sworn in, he died at 55 on Christmas Eve.

One Southern Democrat from Tennessee, apparently not feeling the spirit of the season, wrote in the Memphis Avalanche: “A president as mean and malignant as himself appointed him United States Supreme Court Judge. [But God] smote the unctuous scoundrel so that he died. … Stanton the infamous is drinking molten iron, trading in pyrotechnics, and broiling in a heated furnace, and the people rejoice.”

correction

An earlier version of this story incorrectly stated that Ulysses S. Grant defeated Andrew Johnson in the 1868 presidential election. Grant defeated Horatio Seymour.

Read more Retropolis: