A Supreme Court justice was dead, and the president, in his last year in office, quickly nominated a prominent lawyer to replace him. But the unlucky nominee’s bid was forestalled by the U.S. Senate, blocked due to the hostile politics of the time. It was 1852, but the doomed confirmation battle sounds a lot like 2016.

“The nomination of Edward A. Bradford…as successor to Justice McKinley was postponed,” reported the New York Times on September 3, 1852. “This is equivalent to a rejection, contingent upon the result of the pending Presidential election. It is intended to reserve this vacancy to be supplied by Gen. Pierce, provided he be elected.”

Last year, when Senate Republicans refused to vote on anyone President Barack Obama nominated to replace the late Justice Antonin Scalia, Democrats protested that the GOP was stealing the seat, flouting more than a century of Senate precedent about how to treat Supreme Court nominees. Senate Democrats such as Chuck Schumer and Patrick Leahy called the GOP’s move unprecedented, but wisely stuck to 20th-century examples when they talked about justices confirmed in election years. That’s because conservatives who argued that the Senate has refused to vote on Supreme Court nominees before had some history, albeit very old history, on their side.

What the Senate did to Merrick Garland in 2016, it did it to three other presidents’ nominees between 1844 and 1866, though the timelines and circumstances differed. Those decades of gridlock, crisis and meltdown in American politics left a trail of snubbed Supreme Court wannabes in their wake. And they produced justices who—as Neil Gorsuch might—ascended to Supreme Court seats set aside for them through political calculation.

“There is this tendency to view history through rose-colored glasses from time to time, and to suggest we’ve never been this political,” says Charles Gardner Geyh, a law professor at Indiana University and author of the 2008 book When Courts and Congress Collide. “In reality, we have always had a highly politicized selection process.” Several times in the 1800s, Geyh says, “the Senate certainly appears to have delayed with an eye toward saving the nomination for the next president.”

Though Garland’s failed nomination was far from unprecedented, at least one aspect of the modern Republican Senate’s move was new. The mid-1800s seat-snatchings took place before hearings on Supreme Court nominees were standard protocol, and before nominations were the subject of much open debate. So the historical record of why the Senate ran out the clock on the early nominees is thin, leaving historians to interpret its political motives from news accounts and correspondence of the time. Past senators kept their political motives unspoken; today’s admit them with pride.

“On several of these failed nominations, there seem to have been ostensible merit-based objections,” says Geyh. “Even you if can look at it and raise your eyebrows, and say, ‘Well, that really doesn’t seem like the real reason,’ they at least felt they needed that fig leaf. There was no such fig leaf with Garland.”

Battles over a president’s late-term judicial nominations are nearly as old as the Constitution itself. Thomas Jefferson’s successful fight against John Adams’ “midnight judges,” appointees rushed through in Adams’ last days in office in 1801, led to the famed Supreme Court case Marbury vs. Madison.

While the case is well known for establishing the court’s power of judicial review, its facts are less remembered. Just before Adams left office, Congress created dozens of new judicial positions. Adams quickly appointed men to fill them. When Jefferson took office, he refused to acknowledge some of Adams’ judicial appointments. William Marbury, an Adams appointee for District of Columbia justice of the peace, sued to receive his commission anyway, but lost the case. Jefferson later convinced Congress to abolish the new judgeships.

The next big nomination battle, also after an election, involved Adams’ son. In December 1828, two weeks after Andrew Jackson defeated incumbent John Quincy Adams in the Electoral College, Adams nominated Kentucky lawyer John Crittenden to replace Justice Robert Trimble, who had died that August. The Senate, voting largely along partisan lines in February 1829, postponed Crittenden’s nomination, as well as two of Adams’ three December nominations for federal district judgeships. That the Senate was saving the seat for Jackson to fill was lost on no one. “What a set of corrupt scoundrels,” Kentucky congressman John Chambers wrote to Crittenden, “and what an infernal precedent they are about to establish.”

In 1844, the Senate went a step further, blocking President John Tyler from filling a Supreme Court seat before an election. Tyler, the first unelected president, ascended from the vice presidency in 1841 after William Henry Harrison’s death. His fights with his fellow Whigs started quickly, and in 1842, they threw him out of the party. By 1844, when the deaths of two justices gave Tyler two Supreme Court seats to fill, the Senate was in no mood to accept his nominees.

Stubbornly, Tyler nominated his brusque, short-tempered Treasury secretary, John C. Spencer, for the first open court seat in January 1844. The Senate rejected Spencer, 26-21, after a closed debate, with most Whigs voting against him. Spencer’s personality and politics both played a part in his defeat; Whigs felt that his decision to accept a spot in Tyler’s cabinet was traitorous. But historians think politics played a larger role in what happened next.

In March, Tyler put forward Reuben Walworth, chancellor of New York’s state court system, followed by Edward King, a well-respected Pennsylvania judge, for the two open seats. The Senate sat on both nominations for almost a year without explanation. “The heated contest which had long prevailed between the President and the Whig Senate made it unlikely that his appointments would be confirmed,” Charles Warren wrote in his 1922 book, The Supreme Court in United States History.

What’s more, noted Warren, Crittenden—the rejected 1828 nominee—was a favorite for the Court if Henry Clay, also a Whig, won the election. The prospect of a 16-years-too-late victory may have motivated Walworth’s toughest critics. They included Whig Thurlow Weed of New York, who called Walworth “odious,” “querulous,” and “disagreeable” in a letter to Crittenden.

But that's not why Walworth never became a Supreme Court justice. In February 1845, after Democrat James K. Polk beat Clay, Tyler substituted two new nominees for Walworth and King. The Whig Senate allowed Tyler to fill one of the two court seats. He offered Samuel Nelson, another top New York judge. “Nelson was a lawyer of conspicuous ability,” Warren wrote. “The choice was so preeminently a wise one that the Senate at once confirmed it.”

Tyler’s late replacement nomination for King, though, was tabled without a vote. Once Polk took office, he filled the seat with Pennsylvania judge Robert Grier, who served on the Supreme Court for 21 years.

It’s no coincidence that Tyler and the next two presidents to be denied Supreme Court nominations in an election year are among the least-respected presidents in American history. Tyler, Millard Fillmore and Andrew Johnson were the first unelected presidents, political misfits who ascended from the vice-presidency after presidents’ deaths and quickly fell into deep conflicts with Congress. “It doesn’t help that these guys are not only [considered] illegitimate, but despised,” says Geyh.

Fillmore, the last Whig president, was a famously disagreeable man who started his administration by firing the late Zachary Taylor’s entire cabinet. By the time Justice John McKinley died in 1852, Fillmore had already lost his party's nomination for a second term in office. “Everyone knew he had already lost,” says Geyh, “so he was doubly de-legitimated.”

On August 16, Fillmore nominated Edward A. Bradford, a Louisiana attorney. The Democrat-controlled Senate adjourned two weeks later without confirming Bradford, offering no explanation. Pierce did win the presidency, so lame-duck Fillmore tried twice more, nominating U.S. Sen. George E. Badger, then New Orleans attorney William Micou, in early 1853. But the Senate ran out the clock.

“It acquired almost a flavor of the pathetic,” Geyh says. “[Fillmore] could produce the second coming of Jesus Christ and nothing was going to happen.” Pierce's justice, John Campbell, was a Democrat from Alabama who joined the court’s pro-slavery majority in Dred Scott vs. Sandford and vacated his seat to join the Confederacy as assistant secretary of war in 1861.

The most audacious block of a president’s ability to name a justice came in 1866, when new president Andrew Johnson tried to fill a Supreme Court seat left vacant for months, and Congress killed the nomination by shrinking the size of the court. Abraham Lincoln had named Johnson, a Tennessee Democrat, his 1864 running mate to balance his ticket, but in 1866, Johnson and Congress’ radical Republicans began openly feuding over how to treat the South during Reconstruction. Johnson’s April 16, 1866, nomination of Henry Stanbery, a former Ohio attorney general and advisor to the president, was doomed from the start.

Three weeks earlier, Johnson had vetoed the Civil Rights Act of 1866, which granted ex-slaves full citizenship rights. Congress overrode his veto and passed the law anyway. Word in Washington was that Stanbery had encouraged the veto and possibly even drafted the veto statement. “This, from the radical standpoint, is an unpardonable offense,” wrote the Cincinnati Enquirer’s Washington correspondent on April 21. “This very fact will probably defeat the confirmation of Mr. Stanbery as Judge, not directly, however, but indirectly.” The Enquirer correspondent correctly predicted that the Senate would block Stanbery by approving a pending House bill to reduce the Supreme Court’s size.

In July, the Senate voted unanimously to reduce the Supreme Court from ten justices to seven as vacancies opened up. Days afterward, Johnson successfully nominated Stanbery for attorney general instead. (Why didn’t Johnson veto the court bill? Perhaps he thought Congress would override him again: it passed the House with a veto-proof majority of 78-41.)

Did Congress trim the court’s size to sandbag Stanbery and Johnson? Historians disagree. Some argue that the bill addressed concerns from sitting justices that a court of ten was too big. But the timing of the move – just days after Congress overrode Johnson’s veto of the second Freedman’s Bureau bill – bolsters the argument that partisan politics motivated the Radical Republicans.

Stanbery went on to deliver the successful closing argument for the defense at Johnson’s 1868 impeachment trial. After Ulysses S. Grant succeeded Johnson in 1869, Congress increased the number of justices to nine, a number that’s stood ever since. “[Congress has] developed a norm that you don’t play games with the size of the Supreme Court as a way to score political points,” Geyh says. That precedent grew with the 1937 rejection of Franklin D. Roosevelt’s court-packing plan.

Despite the stolen Supreme Court seats of the mid-1800s, says Geyh, the modern Senate’s outright declaration that no Obama nominee would get a hearing or vote in 2016 still violated the Senate’s norms. None of the tabled nominees of the 1800s were federal judges like Garland, whose qualifications the Senate endorsed in 1997 by confirming him for his appeals court seat, 76-23. “You’ve got a consensus choice,” says Geyh, “which makes it all the more bald-faced that the Senate would do as it did.”