The United States' Supreme Court ruled on Tuesday that President Donald Trump's executive order restricting birthright citizenship is unlawful.

In one of the most consequential decisions for the top court, which had waited until the final day of the term, justices ruled 6-3 to maintain the right to US citizenship for nearly everyone born on US soil.

Trump issued the order on ⁠the first day of his second term in office last ⁠year as part of a range of policies aimed at cracking down on immigration, both legal and illegal.

Justices had already expressed skepticism during oral arguments in April, which Trump personally attended in a highly unusual move for a sitting US president.

The order had directed governed agencies not to recognize the citizenship of children born in the United States if neither parent is a US citizen or "green card" holder, a legal permanent resident.