“We’re the only country in the world where a person comes in and has a baby, and the baby is essentially a citizen of the United States,” President Trump falsely claimed when rolling out his promise to end birthright citizenship last fall. That statement is wrong: Dozens of countries around the world have some form of birthright citizenship.

If you look at a map of the countries that have unrestricted birthright citizenship, you would see that most of them are in the Americas. Birthright citizenship is a distinct tradition of the American continents. It is our shared contribution to global democracy. Understanding why birthright citizenship has flourished in the Americas has become increasingly important as nativists target the practice as part of a broader program of immigration restriction.

The story of birthright citizenship is the history of how the American republics of the 19th century answered the question of what would unite their new citizens. Would it be the national origin of their ancestors? Would it be race? Or would it be the soil on which they were born and raised? It was the 19th century, a time when most of the world — including Europe — was still ruled by monarchies. There were not clear rules about how to create a republic or define a citizen. That made the Americas, where people had spent the past century tossing off imperial rulers and establishing new governments, true workshops of democracy.

Spanish America came to the birthright solution early. Napoleon Bonaparte’s invasion of Spain and the imprisonment of its king in the 1810s created a crisis of legitimacy in the sprawling Spanish empire. The cities and provinces that rebelled against the invading Bonaparte asked: With the king in prison, who had the right to govern the empire?

They answered by calling for a constitutional convention in the rebel city of Cadiz, Spain, where delegates from all over the empire gathered in 1810 to draft a constitution. One of the most controversial debates at this gathering was whether free blacks — at the time, most blacks in Spanish America were not slaves — had the right to be citizens.

Much depended on the answer. Giving citizenship to free blacks would overturn centuries of colonial legislation that deemed them inferior to whites. It would also increase the proportion of Spanish America delegates in the proposed new parliament to the point that they, not the Spanish delegates, would control it.

Spanish delegates supported granting citizenship to anyone whose ancestors could be traced back to Spain or to the Americas, but not to Africa. This measure included people of indigenous and European descent and excluded people of African descent. The delegates from Spanish America opposed them with great creativity. They had to find something that united all inhabitants of the empire regardless of the geographical origin of their ancestors or their skin color.

Soil was the answer on which they settled. In the words of a Spanish America delegate: People of African descent born in the Americas “were Spanish by birth; from their cradle, they had suckled the Spanish religion, language, customs, and concerns.” Another deputy argued that they were “shaped by the land,” which they loved as their fatherland. To deprive them of that right was to condemn them to never belonging to the nation where they were born. In the view of these delegates, soil was the only answer to old ideas that had linked blood or race (raíz, or roots) to impurity and difference.

Although the Spanish America delegates lost at Cadiz, their arguments in defense of birthright citizenship set the parameters for the constitutions of the new Spanish America republics. For example, in the Republic of Colombia, the foundational constitution of 1821 declared citizens “all free men born in Colombia.” It also decreed a free-womb law, which ensured that no more slaves would be born on Colombian soil. In 1852, the country abolished slavery, and the next year, a new constitution extended citizenship rights to former slaves and declared universal manhood suffrage.

Similarly, in Argentina, the 1826 constitution granted citizenship to “all free men born in its land.” In 1853, a new constitution abolished slavery and granted the equality of all men.

The United States followed suit with the 1865 abolition of slavery. Thanks to the 14th Amendment, ratified three years later, anyone born on U.S. soil had the right to be a citizen regardless of their race or their parents’ origin. As in Spanish America, U.S. legislators sought to include former slaves in the nation by guaranteeing their citizenship rights.

It is worth noting that neither the 14th Amendment, nor the citizenship laws in Spanish America, would have been possible without the political pressure of people of African descent. Because of their efforts, by the end of the 19th century, birthright citizenship had come to characterize most republics of the American continents.

Birthright citizenship was a noble attempt at making democracy a reality in republics that were built on slavery and still grappling with racism. Nineteenth-century legislators in favor of birthright citizenship knew that without it, equality would be impossible and citizenship would be the privilege of a few inhabitants. They knew that for democracy to work, people born in the same land had to have the same right to citizenship, regardless of their parents’ origin. Birthright citizenship was fundamental to the basic republican idea that merit, not birth, should determine a person’s future.

Given this common history, what gives force to current attacks against birthright citizenship? Unsurprisingly, they are fueled by racism and a sense of restrictive nationalism, which occludes what ought to be a point of Pan-American pride: originating birthright citizenship. For the sake of our democracy, it is time to remember the origins of birthright citizenship and to dismiss once and for all the unfortunate prejudices that make us question one of the pillars of American democracy.