For nearly 160 years, the 14th Amendment of the US Constitution has established the principle that anyone born in the country is a US citizen, with exceptions for children born to diplomats and foreign military forces.

The language of the amendment states: “All persons born or naturalized in the United States, and subject to the jurisdiction thereof, are citizens of the United States.”

Trump’s executive order sought to deny citizenship to the children of people who are either in the US illegally or are in the country on temporary visas.

The US is one of about 30 countries – mostly in the Americas – that grant automatic citizenship to anyone born within their borders.

After legal challenges were brought to Trump’s executive order, several federal court judges ruled that it violated the Constitution, while two federal circuit courts of appeals upheld injunctions blocking the order from going into effect.

Trump then went to the Supreme Court to fight the injunctions. In a win for Trump, the court ruled in June that the injunctions issued by the lower courts exceeded their authority, though it did not address the issue of birthright citizenship itself.

The 14th Amendment was passed in the wake of the US Civil War in order to settle the question of the citizenship of freed, American-born former slaves.