Back in 2015, Kansas passed SB 95 to restrict access to abortion. The law, like many other anti-abortion measures across the country, was quickly challenged in court. So far, a pretty typical story.

Here’s where it takes a very weird turn: To defend the law in court, Kansas Solicitor General Stephen McAllister cited the US Supreme Court’s 1857 Dred Scott decision — which effectively allowed the expansion of slavery in the US — to argue that the anti-abortion law is constitutional.

Some background first: The ACLU and the Constitutional Accountability Center are challenging Kansas’s law on the grounds that if the 14th Amendment protects the right to an abortion, as the Supreme Court has found, then Section 1 of the Kansas Constitution does as well. That’s because both can be interpreted do the same thing: provide equal protection and due process to all people under the law.

The 14th Amendment states, “No state shall make or enforce any law which shall abridge the privileges or immunities of citizens of the United States; nor shall any state deprive any person of life, liberty, or property, without due process of law; nor deny to any person within its jurisdiction the equal protection of the laws.” And the Kansas Constitution says that “all men are possessed of equal and inalienable natural rights, among which are life, liberty, and the pursuit of happiness.” Both draw from the Declaration of Independence as inspiration.

What does Dred Scott have to do with any of this? Mark Joseph Stern explained for Slate:

In his brief, Solicitor General Stephen R. McAllister insists that this argument is flawed because “[c]ourts across the country have recognized that ‘[t]he Declaration of Independence is a statement of ideals, not law.’ ” Thus, the Kansas Constitution’s adoption of the Declaration’s language provides no fundamental rights to Kansas residents—certainly not the right to an abortion. To support this proposition, McAllister cites, among other cases, Dred Scott, explaining that the decision described “the Declaration’s description of unalienable rights as merely ‘general words used in that memorable instrument’ and [held] that the Declaration did not have a legally binding effect.” That is a curious choice, because Dred Scott is widely acknowledged as the worst Supreme Court decision of all time. Handed down in 1857, Dred Scott held that people “of African descent” are not and cannot become citizens under the United States Constitution. In his majority opinion, Chief Justice Roger B. Taney explained that blacks have long been “regarded as beings of an inferior order, and altogether unfit to associate with the white race, either in social or political relations; and so far inferior, that they had no rights which the white man was bound to respect; and … might justly and lawfully be reduced to slavery for his benefit.”

Really, no one should cite Dred Scott in an approving manner. It will always look bad. But what’s even more perplexing is that there was simply no good reason for McAllister to include such a controversial case in his brief.

The solicitor general was trying to argue that Section 1 of the Kansas Constitution was not, unlike the 14th Amendment, written with the intent to establish a broad scope of rights. McAllister’s brief pointed out that Section 1 doesn’t mention abortion, privacy, or, in a key difference to the 14th Amendment, due process. And he argued Section 1’s writers only included it to show broad support for the Declaration of Independence and equal rights for people of all races. So, in his view, it would be interpreting Section 1 too broadly to declare that it allows abortion.

But you can make this case by citing other cases. McAllister, in fact, cites several cases besides Dred Scott to make this exact point. So choosing to include Dred Scott not only looks bad, but it seems totally unnecessary.

Update: After swift backlash, Kansas on Wednesday withdrew its Dred Scott–referencing brief. Kansas Attorney General Derek Schmidt issued an apology in a statement:

Yesterday’s reference to Dred Scott in a State’s response brief does not accurately reflect the State’s position, is not necessary for the State’s legal argument, and should not have been made. Neither the State nor its attorneys believe or were arguing that Dred Scott was correctly decided. Nonetheless, the reference to that case was obviously inappropriate, and as soon as I became aware of it today, I ordered the State’s brief withdrawn. The unfortunate use of this citation should not distract from the important question the Kansas Supreme Court faces in this case: Whether the Kansas Constitution establishes a state-level right to abortion. The State will continue to argue vigorously that it does not.

Kansas will likely file another one to defend its anti-abortion law — hopefully without mentioning any pro-slavery Supreme Court decisions in the process.

Watch: Proof that “pro-choice” and “pro-life” labels don’t work