About a decade ago, advocates of enhanced border security and immigration restriction began to challenge the principle of birthright citizenship. In 2009, several members of Congress proposed, unsuccessfully, legislation denying citizenship to the American-born children of undocumented immigrants. The Arizona Senate in 2011 debated a similar bill.

As a candidate and then president, Donald Trump repeatedly condemned birthright citizenship. Although over three-dozen countries, including Canada and Mexico, automatically confer citizenship on anyone born on their soil, he insisted that, “We are the only country in the world where a person comes in and has a baby that that baby is essentially a citizen of the United States for 85 years with all those benefits … it’s ridiculous … and it has to end.” Trump also suggested that many mothers traveled to the United States specifically to give birth to what he dubbed “anchor babies.” Unless Congress plugged these “loopholes,” Trump threatened to do so by executive order.

Like many of the nation’s most vexing problems, controversies over birthright citizenship have roots in the original sin of slavery.

In 1857, the Supreme Court ruled in the case of Dred Scott v. Sandford that Scott, an enslaved African-American, had no claim on freedom just because his owner had taken him from Missouri to Illinois and the Wisconsin territory where Congress had prohibited slavery. In an expansive decision written by Chief Justice Roger Taney, the court held that no one of African origin, whether slave or free, could ever become a citizen of the United States. Since slaves were merely “property,” not citizens, Congress could not bar slavery from the western territories, as it had done frequently since the 1780s.

The ruling, universally considered among the worst rendered by the high court, implied — as the rising Republican politician Abraham Lincoln warned — that northern states might soon be forbidden to outlaw slavery even within their boundaries or to recognize free blacks as citizens. Taney’s hope to enshrine slavery nationally backfired. Many northerners saw it as evidence of a plot by the “slave power” to impose slavery on the emerging states of the trans-Mississippi west and dominate the nation. It inflamed sectional hostility and contributed to the outbreak of the Civil War following Lincoln’s election as president in 1860.

Lincoln’s Emancipation Proclamation in January 1863 abolished slavery in states still in rebellion. Ratification of the 13th Amendment in December 1865 ended slavery nationally. But the Scott decision remained a barrier to full citizenship for those of African descent. In 1866, Congress passed a civil-rights law — enacted over President Andrew Johnson’s veto — granting citizenship to all persons born in the United States.

To prevent a future Congress or president from backsliding, Congress drafted the 14th Amendment to the Constitution, ratified by the states in 1868. It stated that, “All persons born or naturalized in the United States and subject to the jurisdiction thereof, are citizens of the United States and of the State wherin they reside.” All citizens were guaranteed “equal protection of the laws” and no state could abridge these rights “without due process of law.”

In 1898, the Supreme Court defined the meaning of birthright citizenship in the case of United States v. Wong Kim Ark. Wong was born in San Francisco in 1873 to Chinese migrants. A decade later, in 1882, Congress passed the Chinese Exclusion Act that prohibited most new Chinese immigration and barred Chinese already resident from ever becoming naturalized citizens. As an adult, Wong visited relatives in China but was refused re-entry into the United States as an inadmissible alien. He sued for re-admission on the grounds of birthright citizenship.

In a strongly worded opinion, the court sided with Wong. The justices held that although his parents were aliens ineligible for citizenship, the 14th Amendment clearly made Wong a citizen by birth. They rejected claims that as non-citizens Wong’s parents (and hence their child) were not “subject to the jurisdiction” of the United States. This clause, the justices explained, merely exempted the families of foreign diplomats and did exclude anyone born in the country, whatever their parent’s status. The decision put the matter to rest for over a century.

To get around the fact that neither Congress nor the president can override a constitutional guarantee, some of President Trump’s advisers argue that federal courts and members of Congress have simply misinterpreted the 14th Amendment or misapplied the Wong precedent.

For example, Vice President Mike Pence stated that the phrase “subject to the jurisdiction thereof” means that birthright citizenship does not necessarily apply to “people who are in the country illegally.” Trump advisers Michael Anton and Stephen Miller derided birthright citizenship as little more than a “magnet for illegal immigration.” They, and a handful of legal scholars, argue that since Wong’s parents entered the country before passage of the Chinese Exclusion Act, they were not, technically, “illegals,” merely residents ineligible for citizenship. Even if Wong qualified as a citizen, his circumstances differed from children born to undocumented mothers. This would allow Congress or the president to restrict birthright citizenship.

Most legal scholars and politicians — liberal and conservative — reject this attempt to get around the clear words of the 14th Amendment.

Researchers have also debunked claims that foreign women flock to the United States to deliver “anchor babies.” So-called birth tourism is a tiny subset of all immigration, generally confined to wealthy women who enter legally on tourist visas. They want a U.S. passport for their child but typically leave the country with their newborns soon after giving birth.

Insisting that standards aside from birth or naturalization — be it education, property ownership, race or a mother’s immigration status — entitles or disqualifies a person for citizenship echoes Taney’s efforts in 1857 to bar anyone of African descent from citizenship. That disastrous judgment propelled the country toward civil war.

Michael Schaller is Regents’ Professor emeritus of history at the University of Arizona. He has written several books on U.S. history, focusing on America’s international relations.